home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / WebsiteX5 / wsx5_free.exe / {app} / Res / x5engine.js < prev    next >
Text File  |  2011-08-29  |  99KB  |  1 lines

  1. jQuery.imCookie=function(a,b,d){if(b!=null){d=d||{};if(d.expires==null)d.expires=60;if(b===null)b="",d.expires=-1;var c="";if(d.expires&&(typeof d.expires=="number"||d.expires.toUTCString))typeof d.expires=="number"?(c=new Date,c.setTime(c.getTime()+d.expires*864E5)):c=d.expires,c="; expires="+c.toUTCString();var e=d.path?"; path="+d.path:"",h=d.domain?"; domain="+d.domain:";",d=d.secure?"; secure":"";document.cookie=[a,"=",encodeURIComponent(b),c,e,h,d].join("")}else{b=null;if(document.cookie&&document.cookie!== ""){d=document.cookie.split(";");for(c=0;c<d.length;c++)if(e=jQuery.trim(d[c]),e.substring(0,a.length+1)==a+"="){b=decodeURIComponent(e.substring(a.length+1));break}}return b}};jQuery.extend(jQuery.easing,{imBounce:function(a,b,d,c,e){return(b/=e)<1/2.75?c*7.5625*b*b+d:b<2/2.75?c*(7.5625*(b-=1.5/2.75)*b+0.75)+d:b<2.5/2.75?c*(7.5625*(b-=2.25/2.75)*b+0.9375)+d:c*(7.5625*(b-=2.625/2.75)*b+0.984375)+d}}); var x5engine={settings:{imGrid:{enabled:!1},imSound:{idName:"imJSSound"},imCaptcha:{offlineCodes:[]},zIndex:{menu:1E4,datePicker:10201,tip:10221,showBox:10301,splashBox:10401,popup:10501},general:{preview:!0},imShowBox:{background:"black",opacity:0.6,border:10,closeImg:"res/imClose.png",loadingImg:"res/imLoad.gif",textColor:"black",boxColor:"white",effect:"fade",shadow:!1,innerBorder:12},imPopUp:{background:"black",opacity:0.6,borderRadius:10,textColor:"black",boxColor:"white",effect:"fade",shadow:!1}, imTip:{borderRadius:10,classes:"",shadow:!0,arrow:!0,position:"right",effect:"fade",showTail:!0,persistant:!1,unique:!0},imAdv:{},imAlertBox:{position:"top",sound:"",cookie:!1,image:"",link:""},imSplashBox:{position:"center",sound:"",effect:"none",shadow:!0,margin:0,width:100,height:100,cookie:!1,image:"",link:""},imBlog:{posts:[],posts_month:[],posts_cat:[],posts_ids:[],comments:!1,captcha:!1}},l10n:{_l10n:[],addLocalization:function(a,b){x5engine.l10n._l10n[a]=b},getLocalization:function(a){return a== null||a==""||x5engine.l10n._l10n[a]==null||x5engine.l10n._l10n[a]=="undefined"||x5engine.l10n._l10n[a]==""?"":x5engine.l10n._l10n[a]}},utils:{hex2rgb:function(a,b,d,c){for(var a=a.replace("#","").match(/(.{2})/g),e=3;e--;)a[e]=parseInt(a[e],16);b!=null&&(a[0]+=b);d!=null&&(a[1]+=d);c!=null&&(a[2]+=c);for(e=0;e<3;e++)a[e]>255&&(a[e]=255),a[e]<0&&(a[e]=0);return"rgb("+a.join(", ")+")"},imFormatInt:function(a){a<10&&(a="0"+a);return a},popup:function(a){(new x5engine.utils.Gui).showPopUp(a)},Gui:function(){var a= function(a){$("#imGuiPopUp").fadeOut(a);$("#imGuiPopUpBg").fadeOut(a,function(){$("#imGuiPopUp").remove();$("#imGuiPopUpBg").remove()})};this.showPopUp=function(b){b.width=b.width||x5engine.settings.imPopUp.width;b.borderRadius=b.borderRadius||x5engine.settings.imPopUp.borderRadius;b.backGround=b.background||x5engine.settings.imPopUp.background;b.effect=b.effect||x5engine.settings.imPopUp.effect;b.textColor=b.textColor||x5engine.settings.imPopUp.textColor;b.boxColor=b.boxColor||x5engine.settings.imPopUp.boxColor; b.opacity=b.opacity||x5engine.settings.imPopUp.opacity;if(b.graphics==null)b.graphics=!0;if(b.graphics){b.text=b.text.replace(/&/g,"&").replace(/\>/g,">").replace(/\</g,"<");var d;d=b.effect!="none"?200:0;if(b.shadow==null)b.shadow=x5engine.settings.imPopUp.shadow;$("#imGuiPopUpBG").remove();$("#imGuiPopUp").remove();var c='<div id="imGuiPopUpBg"></div><div id="imGuiPopUp">'+b.text+'<div id="imCloseButton" class="imGuiButton">OK</div></div>';$("body").append(c);$("#imGuiPopUpBg").css({zIndex:x5engine.settings.zIndex.popup}); $("#imGuiPopUp").css({zIndex:x5engine.settings.zIndex.popup+1});$("#imGuiPopUp").fadeOut(0);b.shadow&&($("#imGuiPopUp").css("box-shadow","0px 5px 30px #000"),$("#imGuiPopUp").css("-webkit-box-shadow","0px 5px 30px #000"),$("#imGuiPopUp").css("-moz-box-shadow","0px 5px 30px #000"));$("#imGuiPopUp").css("-moz-border-radius",b.borderRadius+"px");$("#imGuiPopUp").css("-webkit-border-radius",b.borderRadius+"px");$("#imGuiPopUp").css("border-radius",b.borderRadius+"px");$(".imGuiButton").css("-moz-border-radius", b.borderRadius+"px");$(".imGuiButton").css("-webkit-border-radius",b.borderRadius+"px");$(".imGuiButton").css("border-radius",b.borderRadius+"px");$("#imGuiPopUpBg").css({width:$(window).width(),height:$(window).height()});$("#imGuiPopUp").width(b.width);$("#imGuiPopUp").css({position:"fixed",top:($(window).height()-$("#imGuiPopUp").outerHeight())/2,left:($(window).width()-$("#imGuiPopUp").outerWidth())/2});$("#imGuiPopUpBg").click(function(){a(d)});$("#imCloseButton").click(function(){a(d)});$("#imGuiPopUp").fadeIn(d); $("#imGuiPopUpBg").fadeOut(1,function(){$("#imGuiPopUpBg").fadeTo(d,b.opacity)})}else alert(b.text.replace(/&/g,"&").replace(/\>/g,">").replace(/\</g,"<").replace(/<br[\s]*\/>/g,"\n").replace(/<([A-Z][A-Z0-9]*)\b[^>]*\/?>/g,""))};this.removeLabels=function(){$(".imGuiLabel").remove()};this.showLabel=function(a){for(var d=0;$("#imGuiLabel"+d).length>0;)d++;var d="imGuiLabel"+d,c="<div class='imGuiLabel' id='"+d+"'>"+a.text+"</div>";$("body").append(c);var e=$("#"+d);e.css("box-shadow","0px 0px 7px #aaa"); e.css("-webkit-box-shadow","0px 0px 7px #aaa");e.css("-moz-box-shadow","0px 0px 7px #aaa");e.css("-moz-border-radius","3px");e.css("-webkit-border-radius","3px");e.css("border-radius","3px");a.object!==null?(a=$(a.object),d=a.offset(),c=d.top+Math.floor((a.outerHeight()-e.outerHeight())/2),c<0&&(c=0),e.css({position:"absolute",top:c,left:d.left+a.outerWidth()+10})):(e.css({width:200,height:50,padding:10}),a=e.outerHeight(),e.css({position:"fixed",bottom:-a,right:30,overflow:"hidden",cursor:"pointer"}), e.animate({bottom:10}));e.fadeTo(300,0.8);e.click(function(){e.fadeOut(100,function(){e.remove()})})}},createId:function(a){for(var a=a||"imObj",b=0;$("#"+a+b).length>0;)b++;return a+b},imGetParameter:function(a){var b="",d=0,c=0;window.top.location.search!==0&&(b=unescape(window.top.location.search));a+="=";if(b.length>0&&(d=b.indexOf(a),d!=-1)){d+=a.length;c=b.indexOf("&",d);if(c==-1)c=b.length;return b.substring(d,c)}return null},imPreloadImages:function(a){for(var b=0;b<a.length;b++)(new Image).src= a[b]},imOpenLocation:function(a){document.location=a},imGetLayer:function(a){return $(a)},imCodeProtection:function(a){document.oncontextmenu=function(){alert("Copyrights "+a+". All rights reserved.");return!1}},imFocus:function(a,b){$(a).css("background-color",b)},imSoundLink:{getMimeType:function(){var a="application/x-mplayer2",b=navigator.userAgent.toLowerCase();navigator.mimeTypes&&b.indexOf("windows")==-1&&navigator.mimeTypes["audio/mpeg"].enabledPlugin&&(a="audio/mpeg");return a},Play:function(a, b){b==null&&(b=!1);x5engine.utils.imSoundLink.Stop();$("body").append('<embed type="'+x5engine.utils.imSoundLink.getMimeType()+'" style="height:0" id="'+x5engine.settings.imSound.idName+'" src="'+a+'" loop="'+b+'" autostart="true" hidden="true" />')},Stop:function(){$("#"+x5engine.settings.imSound.idName).remove()}},imPopUpWin:function(a,b,d,c,e,h){e==void 0&&(e=!1);h==void 0&&(h=1);d==void 0&&(d=-1);c==void 0&&(c=-1);window.open(a,"",e==!0?"":d==-1||c==-1?"width="+screen.width+",height="+screen.height+ ",top=0,left=0,scrollbars="+h+",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no":"width="+d+",height="+c+",top="+(screen.height?(screen.height-c)/2:100)+",left="+(screen.width?(screen.width-d)/2:100)+",scrollbars="+h+",location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no").focus();return!1},switchFocus:function(a){$(a).find(":input").each(function(){var a=$(this).attr("type");a!="button"&&a!="submit"&&a!="reset"&&($(this).focus(function(){$(this).addClass("imFormFocus")}), $(this).blur(function(){$(this).removeClass("imFormFocus")}))})},isOnline:function(){return window.top.location.href.substring(0,4)=="http"?!0:!1},emailTo:function(a,b){for(var d="",c=0;c<a.length;c++)var e=parseInt(a.charAt(c),10),h=b.substring(0,e),b=b.substring(e),d=h+d;location.href="mailto:"+d},bookmark:function(a,b){try{if(window.sidebar)window.sidebar.addPanel(b,a,"");else if(window.opera){var d=document.createElement("A");d.rel="sidebar";d.target="_search";d.title=b;d.href=a;d.click()}else document.all? window.external.AddFavorite(a,b):window.open(a)}catch(c){window.open(a)}},setHomepage:function(a,b){if(document.all)try{a.style.behavior="url(#default#homepage)",a.setHomePage(b)}catch(d){window.open(b)}else if(window.sidebar)try{window.netscape&&netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"),Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch).setCharPref("browser.startup.homepage",b)}catch(c){}},location:function(a){window.top.location.href= a},getParam:function(a){var b="",d=0,c=0;window.top.location.search!=0&&(b=unescape(window.top.location.search));a+="=";if(b.length>0&&(d=b.indexOf(a),d!=-1)){d+=a.length;c=b.indexOf("&",d);if(c==-1)c=b.length;return b.substring(d,c)}return null},offlineMessageTimeout:null,showOfflineMessage:function(a,b,d){var c=function(){$("#imMsgBoxF").height($("#imMsgBox").outerHeight())};if(!x5engine.utils.isOnline()){if($("#imMsgBox").length>0&&$("#imMsgBox").html().indexOf(a)!==-1)return!1;$("#imMsgBox, #imMsgBoxF").remove(); b=b||"";d="z-index: 10200; position: fixed; top: 0; left: 0; right: 0; padding: 8px; background-color: "+(d||"#FFFFE1")+"; font-family: Tahoma; font-size: 8pt; border-bottom: 1px solid gray;";$("#imMsgBox").length==0&&($("body").prepend('<div id="imMsgBoxF"> </div>'),$("body").prepend('<div id="imMsgBox" style="'+d+'">'+(b!=""?'<img style="float: left;" src="'+b+'" />':"")+'<span style="float: left;">'+a+'</span><span id="imMsgBoxClose" style="float: right; cursor: pointer;"><b>X</b></span></div>')); c();$("#imMsgBox, #imMsgBoxF").fadeOut(0);$("#imMsgBox, #imMsgBoxF").slideDown("slow");$(window).unbind("resize",c).resize(c);$("#imMsgBoxClose").unbind("click").click(function(){$("#imMsgBox, #imMsgBoxF").slideUp("slow",function(){$("#imMsgBox, #imMsgBoxF").remove()})})}return!1},alignWelcomePage:function(){var a=function(){var a=$(window).height()-$("#imCell_1").outerHeight();$("#imCell_2").length>0&&(a-=$("#imCell_2").outerHeight());a/=2;a<0&&(a=0);$("#imContent").css({marginTop:a})};a();$(window).unbind("resize", a).resize(a)},autoHeight:function(){$(".autoHeight").each(function(){$(this).height("auto")})},imHash:function(a){for(var b="",d=0,c=a.length-1;c>=0;c--)d+=a.charCodeAt(c)*Math.pow(2,a.length-c);d*=834;d+="";for(a=0;d.length>0;)a+=(parseInt(d.charAt(0))+5)*2,d=d.substr(1),a>61&&(a-=61),b+="QWERTYUIOPASDFGHJKLZXCVBNMqwertyuiopasdfghjklzxcvbnm1234567890".charAt(a);return b}},imBlog:{separator:'<div class="imBlogSeparator"></div>\n',showPost:function(a,b,d){var c="",b=b||0,d=d||0,e=x5engine.settings.imBlog.posts[a]; if(e!=null){c+='<h2 id="imPgTitle" style="display: block;">'+e.title+"</h2>";c+='<div class="imBreadcrumb" style="display: block;">'+x5engine.l10n.getLocalization("blog_published_by")+"<strong> "+e.author+" </strong>";c+=x5engine.l10n.getLocalization("blog_in")+' <a href="?category='+e.category.replace(/[\s]{1}/g,"_")+'">'+e.category+"</a> • "+e.timestamp;e.media!=null&&(c+=' • <a href="'+e.media+'">Download '+e.media.substring(e.media.lastIndexOf("/"))+"</a>");if(e.tag.length>0){c+="<br />Tags: "; for(var h=0;h<e.tag.length;h++)c+='<a href="?tag='+e.tag[h]+'">'+e.tag[h]+"</a>, "}c+="</div>";if(b!=0||d!=0){c+='<div class="imBlogPostBody">';e.mediahtml!=null&&(c+=e.mediahtml);c+=e.body;if(e.sources.length>0){c+='<div class="imBlogSources">';c+="<b>"+x5engine.l10n.getLocalization("blog_sources")+":</b><br />";c+="<ul>";for(d=0;d<e.sources.length;d++)c+="<li>"+e.sources[d]+"</li>";c+="</ul></div>"}c+=(x5engine.settings.imBlog.addThis!=null?"<br />"+x5engine.settings.imBlog.addThis:"")+"<br /><br /></div>"}else c+= '<div class="imBlogPostSummary">'+e.summary+"</div>";b==0&&(c+='<div class="imBlogPostRead"><a class="imCssLink" href="?id='+a+'">'+x5engine.l10n.getLocalization("blog_read_all")+" »</a></div>");b!=0&&x5engine.settings.imBlog.comments&&(c+='<div class="imBlogPostComments">',c+='<div class="imBlogCommentsCount">'+x5engine.l10n.getLocalization("blog_no_comment")+"</div>",c+='<div class="imBlogCommentsForm" style="width: 300px;">',c+='<form id="blogComment" action="#">',c+='<div class="imBlogCommentRow">', c+='<label for="form_name" style="float: left;">'+x5engine.l10n.getLocalization("blog_name")+'*</label> <input type="text" id="form_name" name="name" class="imfield mandatory" style="float: right;" />',c+="</div>",c+='<div class="imBlogCommentRow">',c+='<label for="form_email" style="float: left;">'+x5engine.l10n.getLocalization("blog_email")+'*</label> <input type="text" id="form_email" name="email" class="imfield mandatory valEmail" style="float: right;" />',c+="</div>",c+='<div class="imBlogCommentRow">', c+='<label for="form_url" style="float: left;">'+x5engine.l10n.getLocalization("blog_website")+'</label> <input type="text" id="form_url" name="url" style="float: right;" class="imfield" />',c+="</div>",c+='<div class="imBlogCommentRow">',c+='<label for="form_body" style="clear: both;">'+x5engine.l10n.getLocalization("blog_message")+'*</label><textarea id="form_body" name="body" class="imfield mandatory" style="width: 100%; height: 100px;"></textarea>',c+="</div>",x5engine.settings.imBlog.captcha&& (c+='<div class="imBlogCommentRow" style="text-align: center">',c+='<label for="imCpt" style="float: left;">'+x5engine.l10n.getLocalization("form_captcha_title")+'</label> <input type="text" id="imCpt" name="imCpt" class="imfield imCpt[5,../]" size="5" style="width: 120px; margin: 0 auto;" />',c+="</div>"),c+='<div class="imBlogCommentRow" style="text-align: center; margin-bottom: 15px;"><input type="button" value="'+x5engine.l10n.getLocalization("blog_send")+'" class="imBlogCommentSubmitBtn" onclick="x5engine.imBlog.offlineCheck()"/></div>', c+="</form>",c+="</div>",c+="</div>");return c}},offlineCheck:function(){x5engine.imForm.validate("#blogComment",{type:"tip",showAll:!0})&&x5engine.utils.showOfflineMessage(x5engine.l10n.getLocalization("blog_offline_message"))},showCategory:function(a){var b="";bps=x5engine.settings.imBlog.posts_cat[a];if(bps!=null){if(bps.length>0)for(a=0;a<bps.length;a++)b+=x5engine.imBlog.showPost(bps[a],0,a==bps.length-1?1:0),a>0&&(b+=x5engine.imBlog.separator);else b+='<div class="imBlogEmpty">Empty category</div>'; return b}},showMonth:function(a){var b="";bps=x5engine.settings.imBlog.posts_month[a];if(bps!=null){if(bps.length>0)for(a=0;a<bps.length;a++)b+=x5engine.imBlog.showPost(bps[a],0,a==bps.length-1?1:0),a>0&&(b+=x5engine.imBlog.separator);else b+='<div class="imBlogEmpty">Empty month</div>';return b}},showSearch:function(a){var b="",d=x5engine.settings.imBlog.posts_ids,c=0;if(d!=null){if(d.length>0){for(var e=0;e<d.length;e++)if(x5engine.settings.imBlog.posts[d[e]].title.indexOf(a)!=-1||x5engine.settings.imBlog.posts[d[e]].summary.indexOf(a)!= -1||x5engine.settings.imBlog.posts[d[e]].body.indexOf(a)!=-1)b+=x5engine.imBlog.showPost(d[e],0,c==d.length-1?1:0),c++,e>0&&(b+=x5engine.imBlog.separator);c==0&&(b+='<div class="imBlogEmpty">Empty search</div>')}else b+='<div class="imBlogEmpty">Empty blog</div>';return b}},showLast:function(a){var b=x5engine.settings.imBlog.posts_ids,d="";if(b!=null){if(b.length>0)for(var a=b.length<a?b.length:a,c=0;c<a;c++)d+=x5engine.imBlog.showPost(b[c],0,c==0?1:0),c>0&&(d+=x5engine.imBlog.separator);else d+= '<div class="imBlogEmpty">Empty blog</div>';return d}},showTag:function(a){var b=x5engine.settings.imBlog.posts_ids,d="";if(b!=null){if(b.length>0)for(var c=0;c<b.length;c++){for(var e=x5engine.settings.imBlog.posts[b[c]].tag,h=!1,g=0;g<e.length;g++)e[g]==a&&(h=!0);h&&(d+=x5engine.imBlog.showPost(b[c],0,c==b.length-1?1:0),c>0&&(d+=x5engine.imBlog.separator))}else d+='<div class="imBlogEmpty">Empty blog</div>';return d}},show:function(){x5engine.utils.isOnline()||(x5engine.utils.getParam("id")!=null? $("#imBlogContent").empty().append(x5engine.imBlog.showPost(x5engine.utils.getParam("id"),1)):x5engine.utils.getParam("category")!=null?$("#imBlogContent").empty().append(x5engine.imBlog.showCategory(x5engine.utils.getParam("category"))):x5engine.utils.getParam("tag")!=null?$("#imBlogContent").empty().append(x5engine.imBlog.showTag(x5engine.utils.getParam("tag"))):x5engine.utils.getParam("month")!=null?$("#imBlogContent").empty().append(x5engine.imBlog.showMonth(x5engine.utils.getParam("month"))): x5engine.utils.getParam("search")!=null?$("#imBlogContent").empty().append(x5engine.imBlog.showSearch(x5engine.utils.getParam("search"))):$("#imBlogContent").empty().append(x5engine.imBlog.showLast(10)))}},imQueue:{_init_payload:[],_close_payload:[],_init_setted_up:!1,_close_setted_up:!1,_close_queue_executed:!1,_exec:function(a){for(var b=0;b<a.length;b++)try{$.globalEval(a[b]+";")}catch(d){}},push_init:function(a,b){b=b||!1;if(!b&&$.inArray(a,x5engine.imQueue._init_payload)==-1||b)x5engine.imQueue._init_payload[x5engine.imQueue._init_payload.length]= a;if(!x5engine.imQueue._init_setted_up)$(document).ready(function(){x5engine.imQueue._exec(x5engine.imQueue._init_payload)}),x5engine.imQueue._init_setted_up=!0},push_close:function(a,b){b=b||!1;if(!b&&$.inArray(a,x5engine.imQueue._close_payload)==-1||b)x5engine.imQueue._close_payload[x5engine.imQueue._close_payload.length]=a;if(!x5engine.imQueue._close_setted_up)$(window).bind("beforeunload",function(){if(!x5engine.imQueue._close_queue_executed)x5engine.imQueue._close_queue_executed=!0,x5engine.imQueue._exec(x5engine.imQueue._close_payload)}), x5engine.imQueue._close_setted_up=!0}},imMenu:{setup:function(a){a.target=a.target||"#imMnMn";a.orientation=a.orientation||"horizontal";a.type=a.type||"singleColumn";a.effect=a.effect||"fade";a.opacity=a.opacity||1;a.timeout=a.timeout||300;a.animationTime=a.animationTime||200;a.menuHeight=a.menuHeight||25;a.submenuHeight=a.submenuHeight||25;if(a.verticalScroll==null)a.verticalScroll=!1;var b=$(a.target),d,c=/MSIE 7/.test(navigator.userAgent);/MSIE 8/.test(navigator.userAgent);var e=[],h=[],g,f,j, l=function(b,c){if(b.parent().closest("ul").parent().attr("id")!=$(a.target).attr("id")&&!(b==null||b.length==0))b.data("flip-direction",c),c<0?b.css({marginLeft:-b.parent("li").width()-b.width()}):b.css({marginLeft:0})},i=function(b){b.children("ul, div").stop(!0,!0);b.children("ul, div").length>0&&b.siblings("li").each(function(){h[$(this).attr("id")]!=null&&(clearTimeout(h[$(this).attr("id")]),k($(this)))});if(a.type!="multipleColumn"){var c=b.offset();b.closest("ul").data("flip-direction")!=b.children("ul").data("flip-direction")&& l(b.children("ul"),b.closest("ul").data("flip-direction"));b.children("ul").data("flip-direction")==1&&c.left+b.width()+b.children("ul").width()>$(window).width()+$(window).scrollLeft()&&l(b.children("ul"),-1);b.children("ul").data("flip-direction")==-1&&c.left-b.width()<$(window).scrollLeft()&&l(b.children("ul"),1)}switch(a.effect){case "fade":b.children("ul,div").fadeIn(a.animationTime);break;case "v-slide":b.children("ul,div").slideDown(a.animationTime);break;case "h-slide":if(b.children(".jsOverflowControl").length> 0){if(b.children(".jsOverflowControl").attr("vis")=="false"||b.children(".jsOverflowControl").attr("vis")==null)b.children(".jsOverflowControl").attr("vis","true").width("auto"),c=e[b.children(".jsOverflowControl").attr("id_number")].width,a.orientation!="horizontal"&&b.children(".jsOverflowControl").children("div").css({marginTop:0,marginLeft:0}),b.children(".jsOverflowControl").css({overflow:"hidden",width:0}),b.children(".jsOverflowControl").fadeIn(1).animate({width:c},a.animationTime,null,function(){$(this).css("overflow", "visible")})}else if(b.children("ul").attr("vis")=="false"||b.children("ul").attr("vis")==null)b.children("ul").attr("vis","true").width("auto").height("auto"),c=b.children("ul").width(),b.children("ul.autoHide").css({overflow:"hidden",width:0}),b.children("ul.autoHide").fadeIn(1).animate({width:c},a.animationTime,null,function(){$(this).css("overflow","visible")});break;case "b-slide":if(b.children(".jsOverflowControl").length>0){if(b.children(".jsOverflowControl").attr("vis")=="false"||b.children(".jsOverflowControl").attr("vis")== null){b.children(".jsOverflowControl").attr("vis","true").width("auto");var c=e[b.children(".jsOverflowControl").attr("id_number")].width,d=e[b.children(".jsOverflowControl").attr("id_number")].height;a.orientation!="horizontal"&&b.children(".jsOverflowControl").children("div").css({marginTop:0,marginLeft:0});b.children(".jsOverflowControl").css({overflow:"hidden",width:0,height:0});b.children(".jsOverflowControl").fadeIn(1).animate({width:c,height:d},a.animationTime,null,function(){$(this).css("overflow", "visible")})}}else if(b.children("ul").attr("vis")=="false"||b.children("ul").attr("vis")==null)b.children("ul").attr("vis","true").width("auto").height("auto"),c=b.children("ul").width(),d=b.children("ul").height(),b.children("ul.autoHide").css({overflow:"hidden",width:0,height:0}),b.children("ul.autoHide").fadeIn(1).animate({width:c,height:d},a.animationTime,null,function(){$(this).css("overflow","visible")});break;default:b.children("ul,div").fadeIn(1)}},k=function(b){b.children("ul,div").stop(!0, !0);b.children("ul, div").each(function(){$(this).children("li, ul").each(function(){$(this).is("ul")?$(this).children("li").each(function(){k($(this))}):k($(this))})});switch(a.effect){case "fade":b.children("ul,div").fadeOut(a.animationTime);break;case "v-slide":b.children("ul,div").slideUp(a.animationTime);break;case "h-slide":b.children("div").length==0?b.children("ul").animate({width:0},a.animationTime,"swing",function(){$(this).fadeOut(0);$(this).attr("vis","false")}):b.children("div").animate({width:0}, a.animationTime,"swing",function(){$(this).fadeOut(0);$(this).attr("vis","false")});break;case "b-slide":b.children("div").length==0?b.children("ul").animate({width:0,height:0},a.animationTime,"swing",function(){$(this).fadeOut(0);$(this).css("overflow","hidden");$(this).attr("vis","false")}):b.children("div").animate({width:0,height:0},a.animationTime,"swing",function(){$(this).fadeOut(0);$(this).css("overflow","hidden");$(this).attr("vis","false")});break;case "none":b.children("ul,div").fadeOut(1)}}; b.find(".auto").removeClass("auto").addClass("autoHide");b.find("ul").data("flip-direction",1);a.type=="multipleColumn"&&(a.effect=="h-slide"||a.effect=="b-slide")&&b.find("li > div").each(function(){var a=$(this).width(),b=$(this).height(),c=e.length;$(this).wrapInner('<div style="display: block; width: '+a+"px; height: "+b+'px;" />').addClass("jsOverflowControl");$(this).attr("id_number",c);e[c]={width:a,height:b};$(this).css({overflow:"hidden",width:a,height:b})});c&&a.type!="multipleColumn"&& ($("#imMnMn ul ul ul").css({marginTop:-a.submenuHeight,marginLeft:0}),$("#imMnMn ul ul").css({marginLeft:0}));c&&a.orientation=="horizontal"&&($("#imMnMn > ul > li > ul, #imMnMn > ul > li > div").css("margin-top",0),a.type=="multipleColumn"&&$("#imMnMn > ul > li > div").css("margin-left",0));if(a.type=="accordion"){$(".imMnMnTxt img").css("position");var o=$("#imFooPad").height(),p=function(){$("#imFooPad").height(Math.max(o,$("#imMnMn").children("ul").outerHeight()-($("#imContent").height()-$("#imFooPad").height())))}; $("#imMnMn > ul > li > ul").slideUp(0);$("#imMnMn > ul > li > span.imMnMnFirstBg").click(function(){$(this).parent().siblings("li").each(function(){$(this).children("ul").slideUp(a.animationTime)});$(this).siblings("ul").children("ul").hide(0);$(this).siblings("ul").slideToggle(a.animationTime,p)});p();b=$("#imMnMn > ul > li > ul")}b.find("li").hover(function(){var a=$(this),b=a.attr("id");h[b]!=null&&clearTimeout(h[b]);a.find("div ul ul").hide();h[b]=setTimeout(function(){i(a)},300)});b.find("li").mouseleave(function(){var b= $(this),c=b.attr("id");h[c]!=null&&clearTimeout(h[c]);h[c]=setTimeout(function(){k(b)},a.timeout)});if(a.verticalScroll)d=$(a.target),g=d.offset(),g=g.top,j=$(document).height(),f=d.position(),$(window).scroll(function(){d.stop(!0,!1);var a=d.offset(),b=d.position();((a.top-$(window).scrollTop()<0||$(window).scrollTop()>g)&&$(window).scrollTop()+d.height()<j||f.top<b.top)&&$(window).scrollTop()-g>0?d.animate({marginTop:$(window).scrollTop()-g},"medium"):$(window).scrollTop()-g<=0&&d.animate({marginTop:0}, "fast")})}},imCart:{products:{},html_form:"",payments:[],shippings:[],settings:{vat:0,vatincluded:!1,currency:"\u20ac",currency_id:"EUR",currency_format:"#.###,@@[C]",post_url:"x5cart.php",order_no_format:"[yy][mm][dd]-[A-Z][A-Z][0-9][0-9]",form_autocomplete:!0,form_validation:"tip",continue_shopping_page:"index.html",currencies:["USD","EUR"],cart_price:{multiplier:1,format:"#.@"}},costants:{QUANT_FIELD_NAME:"product_{id}_qty",OPT_FIELD_NAME:"product_{id}_opt",COOKIE_NAME:"imCart",COOKIE_FORM_NAME:"imCartFormData", WIDGET_NAME:"imCartWidget"},payment_type:null,shipping_type:null,email_data:null,product_price_plus_vat:0,total_price:0,setupProductList:function(){$(".imProductListText").each(function(){if($(this).hasClass("imTypeImage")){if(/MSIE/.test(navigator.userAgent)){var a=0;$(this).parent().find(".imProductListBoxAdd img").each(function(){a+=$(this).width()+5});a+=$(this).parent().find(".imProductListQuantity").width()+5;$(this).parent().find(".imProductListBoxAdd").css({width:a})}var b=$(this).parent().find(".imProductListImage img"), d=$(this).parent().find(".imProductListImage"),c=$(this).parent().innerHeight()-$(this).find(".imProductListBuyBox").outerHeight();c<b.height()&&(b.width(Math.floor(c/b.height()*b.width())),b.height(c),d.height(c),b.css({marginTop:0}),$(this).find(".imProductListBuyBox").css({position:"relative",top:0,bottom:0,margin:0,padding:0,clear:"both"}))}else $(this).find(".imProductListBuyBox").css({height:"auto"}),$(this).find(".imProductListFooter").css({height:"auto"}),b=$(this).find(".imProductListFooter select").outerHeight()+ $(this).find(".imProductListBuyBox").outerHeight(),d=$(this).innerHeight()-b-20,$(this).find(".imProductListFooter").css({height:b+10}),$(this).find(".imProductListDescription").css({height:d})})}},imAdv:{width:null,height:null,imShowAdv:function(a,b,d,c,e){var h=/MSIE [6]/.test(navigator.userAgent);x5engine.imAdv.width=a;x5engine.imAdv.height=a;var g='<div id="imWebSiteX5Adv" style="height: '+a/4+"px; width: "+a/4+'px;">',f=x5engine.utils.isOnline()?1:0;h?$("body").append(g+'<object id="imWebSiteX5AdvObj" style="left: -'+ parseInt(a-a/4)+'px" data="res/x5ad.swf?File='+d+"&SoundFile="+escape(c)+"&Url="+e+"&Scale="+b+"&Preview="+f+'" type="application/x-shockwave-flash" width="'+a+'" height="'+a+'"><param name="movie" value="x5advcorner.swf?File='+d+"&SoundFile="+c+"&Url="+e+"&Scale="+b+"&Preview="+f+'"><param name="wmode" value="transparent"><param name="menu" value="false"><param name="allowscriptaccess" value="samedomain"><param name="quality" value="high"><param name="flashvars" value="Licence=Only_For_Incomedia_WebSiteX5&Copyrights=WebSiteX5.com"></object></div>'): $("body").append(g+'<embed id="imWebSiteX5AdvObj" style="left: -'+parseInt(a-a/4)+'px" src="res/x5ad.swf?File='+d+"&SoundFile="+escape(c)+"&Url="+e+"&Scale="+b+"&Preview="+f+'" type="application/x-shockwave-flash" width="'+a+'" height="'+a+'" wmode="transparent" menu="false" allowscriptaccess="samedomain" quality="high" flashvars="Licence=Only_For_Incomedia_WebSiteX5&Copyrights=WebSiteX5.com"></embed></div>');var j=$("#imWebSiteX5Adv");if(f){var l=$("#imWebSiteX5AdvObj"),i=!1,k=function(){j.unbind("mouseleave"); i=!0;setTimeout(function(){j.bind("mouseleave",k);i&&(j.width(parseInt(a/4)),j.height(parseInt(a/4)),l.css("left",parseInt(a/4-a)))},1500)};j.bind("mouseleave",k);j.bind("mouseenter",function(){i=!1;j.width(a);j.height(a);l.css("left",0)})}j.css({zIndex:x5engine.settings.zIndex.splashBox})},imSetSize:function(a,b,d){b==0?(d&&$("#"+a).html($("#"+a).html()),$("#"+a).width(parseInt(x5engine.imAdv.width/4)),$("#"+a).height(parseInt(x5engine.imAdv.height/4)),$("#"+a+"Obj").css("left",parseInt(x5engine.imAdv.width/ 4-x5engine.imAdv.width))):($("#"+a).width(x5engine.imAdv.width),$("#"+a).height(x5engine.imAdv.height),$("#"+a+"Obj").css("left",0))}},imForm:{constants:{mark:"imFormMark"},initForm:function(a,b,d){b=b||!1;d==null&&(d={base:""});$(a).find("label").wrapInner("<span>");$(a).append('<input type="hidden" value="jsactive" name="imJsCheck" />');$(a).find("img").each(function(){$(this).bind("mouseover",function(){x5engine.imTip.Show($(this),{position:"top"})})});b&&$(a).find(":input").each(function(){$("#"+ $(this).attr("id")+"_tip").length>0&&$(this).bind("focus click",function(){$(this).one("blur",function(){$("#"+$(this).attr("id")+"_tip").triggerHandler("mouseout")})})});$(a).find("[class*=datePicker]").each(function(){$(this).attr("class").match(/datePicker\[(.*),([\d]{1})\]/);RegExp.$1!=""&&RegExp.$2!=""&&x5engine.imDatePicker($(this),{format:RegExp.$1.toString(),icon:parseInt(RegExp.$2)==1?!0:!1})});$("[class*=valMaxLength], [class*=valLength]").each(function(){$(this).attr("class").match(/Length\[([0-9]+)\]/g); var a=RegExp.$1;$(this).keyup(function(){$(this).val($(this).val().substring(0,a))})});$("[class*=valNumber]").keypress(function(a){a=a.charCode?a.charCode:a.keyCode;return/^[0-9]+$/g.test($(this).val()+String.fromCharCode(a))});$("[class*=valDate]").keypress(function(a){a=a.charCode?a.charCode:a.keyCode;return/^[0-9\/\.]+$/g.test($(this).val()+String.fromCharCode(a))});$("[class*=valTelephone]").keypress(function(a){a=a.charCode?a.charCode:a.keyCode;return/^[0-9\s\-\(\)]+$/g.test($(this).val()+String.fromCharCode(a))}); x5engine.imForm.showFiles(a);x5engine.imForm.setPagination(a,d);x5engine.imForm.lockCopyPaste(a);x5engine.utils.switchFocus(a);x5engine.imForm.showCaptcha(a);x5engine.imForm.setLabels(a,d);/Chrome/.test(navigator.userAgent)||/MSIE 8/.test(navigator.userAgent)||/MSIE 9/.test(navigator.userAgent)||/MSIE 10/.test(navigator.userAgent)?(b={"padding-left":7,"padding-right":7},$(a).find("input[type=button], input[type=submit], input[type=reset]").css(b)):/Firefox/.test(navigator.userAgent)&&(b={"padding-left":4, "padding-right":4,"padding-bottom":$(a).find(".imFormButtonWrapper").length>0?4:2},$(a).find("input[type=button], input[type=submit], input[type=reset]").css(b));$(a).find("input[type=reset]").click(function(){$("[tiptarget]").remove();$(a).find("."+x5engine.imForm.constants.mark).removeClass(x5engine.imForm.constants.mark);$(a).find("."+x5engine.imTip.constants.locked).removeClass(x5engine.imTip.constants.locked);$(a).find("[class*=datePicker]").val("").attr("value","");return!0})},showFiles:function(a){/Chrome/.test(navigator.userAgent)&& $("input[type=file]").css({height:$(a).find("input[type=text]").innerHeight(),padding:0})},setLabels:function(a,b){$(a).find("input, textarea").not(":submit, :radio, :reset, :hidden, :button").each(function(){if($(this).val()!=""&&$(this).prop("readonly")!=!0){var d,c,e=$(this);b=b||{};e.data("label",$(this).val());b.labelColor!=null&&e.css({color:b.labelColor});e.is("input[type=password]")&&(d=e.attr("id")+"_fake",e.data("password",!0),e.after('<input type="text" class="'+e.attr("class").replace(/mandatory/g, "").replace(/equalTo\[[^\]]+\]/g,"")+'" style="'+e.attr("style")+'" value="'+e.data("label")+'" id="'+d+'"/>').fadeOut(0),c=$("#"+d),e.attr("value",""),c.focus(function(){c.fadeOut(0);e.fadeIn(0);e.focus()}),$(a).find("input[type=reset]").click(function(){e.fadeOut(0);c.fadeIn(0);setTimeout(function(){e.attr("value","")},500)}));e.focus(function(){e.data("password")&&c.fadeOut(0);e.val()==$(this).data("label")&&(e.val(""),e.css({color:b.fieldColor}))});e.blur(function(){e.val()==""&&(e.data("password")&& (e.fadeOut(0),c.fadeIn(0)),e.val(e.data("label")),e.css({color:b.labelColor}))})}})},showCaptcha:function(a){var b="",d,c;$(a).find("[class*=imCpt]").not("iframe").each(function(){$(this).val("");var e="";if(/imCpt\[([0-9]+)\]/.test($(this).attr("class"))){$(this).attr("class").match(/imCpt\[([0-9]+)\]/);var h=RegExp.$1||5;h>9&&(h=9)}else $(this).attr("class").match(/imCpt\[([0-9]+),\s*([^\]]+)\]/),h=RegExp.$1||5,h>9&&(h=9),e=RegExp.$2||"";$(this).attr("class").match(/imCpt\[\]/);for(d=0;d<h;d++){do c= parseInt(Math.random()*9);while(b.indexOf(c)>-1);b+=c}$("#"+$(this).attr("id")+"_imCptHdn").remove();if(x5engine.utils.isOnline())$(".imFrame\\["+$(this).attr("id")+"\\]").remove(),$(this).before('<iframe style="display: block; margin: 3px auto 2px auto; width: 120px; height: 24px; border: 1px solid #BBBBBB" class="imFrame['+$(this).attr("id")+']" src="'+e+"captcha/imcaptcha.php?action=show&code="+b+'" frameborder="0" marginwidth="0" marginheight="0" width="120" height="24" scrolling="no"></iframe><input type="hidden" value="'+ b+'" name="imCptHdn" id="'+$(this).attr("id")+'_imCptHdn"/>');else{$("#"+$(this).attr("id")+"_fakediv").remove();h='<div id="'+$(this).attr("id")+'_fakediv" style="font-size: 8pt; font-family: Tahoma; margin: 3px auto 2px auto; width: 120px; height: 24px; border: 1px solid #BBBBBB">';for(d=0;d<b.length;d++)h+='<img src="'+e+x5engine.settings.imCaptcha.offlineCodes[parseInt(b.charAt(d))].path+'" />';h+="</div>";h+='<input type="hidden" value="';for(d=0;d<b.length;d++)h+=x5engine.settings.imCaptcha.offlineCodes[parseInt(b.charAt(d))].letter; h+='" name="imCptHdn" id="'+$(this).attr("id")+'_imCptHdn"/>';$(this).before(h)}$(a).find("input[type=reset]").click(function(){x5engine.imForm.showCaptcha($(a))})})},checkCaptcha:function(a){var b=a.prev("#"+a.attr("id")+"_imCptHdn").val(),d=a.val(),c="",e=!1;/imCpt\[([0-9]+),\s*([^\]]+)\]/.test(a.attr("class"))&&(a.attr("class").match(/imCpt\[([0-9]+),\s*([^\]]+)\]/),c=RegExp.$2||"");x5engine.utils.isOnline()?$.ajax({url:c+"captcha/imcaptcha.php?action=check&code="+b+"&ans="+d,async:!1,cache:!1, success:function(a){a!="-1"&&(e=!0)}}):d.toLowerCase()==b.toLowerCase()&&(e=!0);return e},setPagination:function(a,b){var d=0,b=b||{},c=b.type||"tip";showPage=function(b,c){c=c||400;$(a+"_next").attr("disabled",!1);$(a+"_prev").attr("disabled",!1);$("."+x5engine.imTip.constants.classId).remove();$("."+x5engine.imForm.constants.mark).removeClass(x5engine.imForm.constants.mark);b==1?($(a+"_prev").fadeOut(0),$(a+"_next").fadeIn(0),$(a+"_submit").fadeOut(0)):$(a).find("[pageCount="+(b+1)+"]").length== 0?($(a+"_prev").fadeIn(0),$(a+"_next").fadeOut(0),$(a+"_submit").fadeIn(0)):($(a+"_prev").fadeIn(0),$(a+"_next").fadeIn(0));$(a).find("fieldset").each(function(){parseInt($(this).attr("pageCount"))==b?$(this).children("div").not(".legend").animate({height:"show"},c):$(this).children("div").not(".legend").animate({height:"hide"},c)})};showNextPage=function(){var b=parseInt($(a+"_pageCounter").val());x5engine.imForm.validate($("fieldset[pageCount="+b+"]"),{showAll:!0,paginate:!0,type:c})==!0&&(b++, $(a).find("[pageCount="+b+"]").length>0?(showPage(b),$(a+"_pageCounter").attr("value",b)):$(a).submit())};showPrevPage=function(){var b=parseInt($(a+"_pageCounter").val());b--;b>0&&($(a+"_pageCounter").attr("value",b),showPage(b))};$(a).find("fieldset").each(function(){$(this).hasClass("newPage")?d++:d==0&&d++;$(this).attr("pageCount",d)});if(d>1){$(a).append('<input type="hidden" name="'+a.replace("#","")+'_pageCounter" id="'+a.replace("#","")+'_pageCounter" value="1" />');$(a).children("div:last").append('<input type="button" id="'+ a.replace("#","")+'_prev" value="'+x5engine.l10n.getLocalization("cart_goback")+'"/>');$(a).children("div:last").append('<input type="button" id="'+a.replace("#","")+'_next" value="'+x5engine.l10n.getLocalization("cart_gonext")+'"/>');var e=$(a).find("input[type=submit]").attr("value");$(a).find("input[type=submit]").remove();$(a).children("div:last").append('<input type="button" id="'+a.replace("#","")+'_submit" value="'+e+'"/>');e=$(a).find("input[type=reset]").attr("value");$(a).find("input[type=reset]").remove(); $(a).children("div:last").append('<input type="button" id="'+a.replace("#","")+'_reset" value="'+e+'"/>');$(a).find(a+"_submit").fadeOut(0);$(a+"_prev").click(showPrevPage);$(a+"_next").click(showNextPage);showPage(1,1)}else e=$(a).find("input[type=submit]").attr("value"),$(a).find("input[type=submit]").after('<input type="button" id="'+a.replace("#","")+'_submit" value="'+e+'"/>'),$(a).find("input[type=submit]").remove();$(a+"_reset").click(function(){$(a)[0].reset();showPage(1)});$(a+"_submit").click(function(){x5engine.imForm.submit(a, b)});$(a).submit(function(){x5engine.imForm.submit(a,b);return!1})},lockCopyPaste:function(a){$(a).find("input[class*=equalTo]").each(function(){for(var a=$(this).attr("class").split(" "),d=0;d<a.length;d++)if(a[d].substring(0,7)=="equalTo"){var c=a[d].substring(8,a[d].length-1);$("#"+c).bind("contextmenu cut copy paste",function(a){a.preventDefault();return!1})}});$(a).find("input[class*=equalTo]").bind("contextmenu cut copy paste",function(a){a.preventDefault();return!1})},validate:function(a,b){var d= !0,c=!1,e,b=b||{},h,g=$(a).attr("id");b==null&&(b={});b.type=b.type||"tip";b.showAll=b.showAll||!1;if(b.type=="popup"||b.type=="alert")b.showAll=!1;b.paginate=b.paginate||!1;$(a).find("*").removeClass(x5engine.imForm.constants.mark);var f=function(a,e){var f=function(){$(this).removeClass(x5engine.imForm.constants.mark);$("[tiptarget="+$(this).attr("id")+"]").remove()},g;g=$(a).is("input[type=radio]")?$("label[for="+$(a).attr("id").substring(0,$(a).attr("id").lastIndexOf("_"))+"] span").html():$("label[for="+ $(a).attr("id")+"] span").html();$(a).is("input[type=password]")&&!$(a).is(":visible")&&($(a).data("label")!=null&&(g=$(a).data("label")),a=$("#"+$(a).attr("id")+"_fake"),$(a).unbind("focus",f).focus(f));$(a).addClass(x5engine.imForm.constants.mark);$(a).is(":radio")&&$(a).css("border","none");if(e!=null&&(!c||b.showAll))if(c=!0,f=x5engine.l10n.getLocalization(e),g==null&&(g=$(a).data("label")),g==null&&(g=""),g!=null){for(var h=!0;g.charAt(g.length-1)==":"||g.charAt(g.length-1)=="*"||g.charAt(g.length- 1)==" ";)g=g.substr(0,g.length-1);try{f=f.replace(/\[FIELD\]/g,"'"+g+"'")}catch(p){}switch(b.type){case "alert":alert(f);break;case "popup":(new x5engine.utils.Gui).showPopUp({text:f});break;default:$(a).attr("class").match(/datePicker\[(.*),([\d]{1})\]/)&&$(a).next("span").find("img.imDatePickerIcon").is("img")!=!1?g=$(a).next("span").find(".imDatePickerIcon"):$(a).is("input[type=radio]")?($(a).click(function(){$(this).unbind("click");$("[tiptarget="+$(this).attr("id").substring(0,$(this).attr("id").lastIndexOf("_"))+ "_target]").remove();$("label[for="+$(a).attr("id").substring(0,$(a).attr("id").lastIndexOf("_"))+"] span").removeClass(x5engine.imTip.constants.locked).attr("id","")}),g=$("label[for="+$(a).attr("id").substring(0,$(a).attr("id").lastIndexOf("_"))+"] span"),g.attr("id",$(a).attr("id").substring(0,$(a).attr("id").lastIndexOf("_"))+"_target"),$("[tiptarget="+$(a).attr("id").substring(0,$(a).attr("id").lastIndexOf("_"))+"_target]").length>0&&(g=null)):$(a).next("img").is("img")?(h=$(a),g=$(a).next("img")): $(a).nextAll("iframe.imFrame\\["+$(a).attr("id")+"\\]").is("iframe")?(h=$(a),g=$(a).nextAll("iframe.imFrame\\["+$(a).attr("id")+"\\]")):g=$(a),g!=null&&(g.removeClass(x5engine.imTip.constants.locked),x5engine.imTip.Show(g,{position:"right",text:f,unique:!1,classes:b.classes,persistant:!0,hideOnFocus:h}))}}d=!1};b.type=="tip"&&$("."+x5engine.imTip.constants.classId).remove();$(a).find("[type=submit]").length>0&&(e=$(a).find("[type=submit]").attr("value"),$(a).find("input[type=submit]").attr("disabled", !0).attr("value",x5engine.l10n.getLocalization("form_validating")));$(a).find(g+"_fakebutton2").length>0&&(h=$(a).find(id+"_fakebutton2").attr("value"),$(a).find(g+"_fakebutton2").attr("disabled",!0).attr("value",x5engine.l10n.getLocalization("form_validating")));(function(){$(a).find(".mandatory").each(function(){$(this).val()==""&&f(this,"form_mandatory")});$(a).find(".mandatory:checkbox").each(function(){this.checked==!1&&f(this,"form_mandatory")});$(a).find(".mandatory:radio").each(function(){$(".mandatory[name="+ $(this).attr("name")+"]:checked").length==0&&f(this,"form_mandatory")});$(a).find("[class*=equalTo]").each(function(){for(var a=$(this).attr("class").split(" "),b=0;b<a.length;b++)if(a[b].substring(0,7)=="equalTo"){var c=a[b].substring(8,a[b].length-1);$(this).val()!=$("[name="+c+"]").val()&&f(this,"form_equal")}});$(a).find("[class*=valMinLength]").each(function(){for(var a=$(this).attr("class").split(" "),b=0;b<a.length;b++)if(a[b].substring(0,12)=="valMinLength"){var c=parseInt(a[b].substring(13, a[b].length-1));$(this).val().length<c&&f(this,"form_length")}});$(a).find("[class*=valLength]").each(function(){for(var a=$(this).attr("class").split(" "),b=0;b<a.length;b++)if(a[b].substring(0,9)=="valLength"){var c=parseInt(a[b].substring(10,a[b].length-1));$(this).val().length!=c&&f(this,"form_length")}});$(a).find(".valNumber").each(function(){$(this).val()!=""&&/^\d*$/.test($(this).val())==!1&&f(this,"form_numbers")});$(a).find(".valChars").each(function(){$(this).val()!=""&&/^\D*$/.test($(this).val())== !1&&f(this,"form_characters")});$(a).find(".valGenTelephone").each(function(){$(this).val()!=""&&/^[0-9\-\.\/\(\)\s]*$/.test($(this).val())==!1&&f(this,"form_telephone")});$(a).find(".valTelephone").each(function(){$(this).val()!=""&&/^[0-9 \-\.\/]*$/.test($(this).val())==!1&&f(this,"form_telephone")});$(a).find(".valUSTelephone").each(function(){$(this).val()!=""&&/^\([1-9]\d{2}\)\s?\d{3}\-\d{4}$/.test($(this).val())==!1&&f(this,"form_telephone")});$(a).find(".valDate").each(function(){$(this).val()!= ""&&/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2}$/.test($(this).val())==!1&&f(this,"form_date")});$(a).find(".valDate2").each(function(){$(this).val()!=""&&/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{2,4}$/.test($(this).val())==!1&&f(this,"form_date")});$(a).find(".valUSDate").each(function(){$(this).val()!=""&&/^\d{1,2}(\-|\/|\.)\d{1,2}\1\d{4}$/.test($(this).val())==!1&&f(this,"form_date")});$(a).find("[class*=datePicker]").each(function(){$(this).attr("class").match(/datePicker\[(.*),([\d]{1})\]/);if($(this).val()!=""&& RegExp.$1!=""&&RegExp.$2!=""){var a=RegExp.$1,a=a.replace(/\//g,"\\/"),a=a.replace(/\s/g,"\\s+"),a=a.replace(/\-/g,"\\-"),a=a.replace(/\./g,"\\."),a=a.replace(/\[dd\]/g,"\\d{1,2}"),a=a.replace(/\[mm\]/g,"\\d{1,2}"),a=a.replace(/\[yy\]/g,"\\d{2}"),a=a.replace(/\[yyyy\]/g,"\\d{4}"),a=a.replace(/\[DD\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),a=a.replace(/\[MM\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),a=a.replace(/\[D\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),a=a.replace(/\[M\]/g, "[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+");RegExp("^"+a+"$").test($(this).val())||f(this,"form_date")}});$(a).find("[class*=valCDate]").each(function(){for(var a=$(this).attr("class").split(" "),b=0;b<a.length;b++)if($(this).val()!=""&&a[b].substring(0,8)=="valCDate"){var c=a[b].substring(9,a[b].length-1),c=c.replace(/\_/g,"\\s"),c=c.replace(/\//g,"\\/"),c=c.replace(/\-/g,"\\-"),c=c.replace(/\./g,"\\."),c=c.replace(/\[dd\]/g,"\\d{1,2}"),c=c.replace(/\[mm\]/g,"\\d{1,2}"),c=c.replace(/\[yy\]/g, "\\d{2}"),c=c.replace(/\[yyyy\]/g,"\\d{4}"),c=c.replace(/\[DD\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),c=c.replace(/\[MM\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),c=c.replace(/\[D\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),c=c.replace(/\[M\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"),c="^"+c+"$";RegExp(c).test($(this).val())||f(this,"form_date")}});$(a).find(".valEmail").each(function(){$(this).val()!=""&&/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i.test($(this).val())== !1&&f(this,"form_email")});$(a).find(".valCF").each(function(){$(this).val($(this).val().toUpperCase());$(this).val()!=""&&/^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/.test($(this).val())==!1&&f(this,"form_CF")});$(a).find(".valURL").each(function(){$(this).val($(this).val().toUpperCase());$(this).val()!=""&&/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/.test($(this).val())==!1&&f(this,"form_URL")});$(a).find(".valUSZIP").each(function(){$(this).val($(this).val().toUpperCase()); $(this).val()!=""&&/(^\d{5}$)|(^\d{5}-\d{4}$)/.test($(this).val())==!1&&f(this,"form_format")});$(a).find("[class*=valCustom]").each(function(){for(var a=$(this).attr("class").split(" "),b=0;b<a.length;b++)if($(this).val()!=""&&a[b].substring(0,9)=="valCustom"){for(var c=a[b].substring(10,a[b].length-1),d="",e=0;e<c.length;e++)switch(c.charAt(e)){case "N":d+="[0-9]{1}";break;case "F":d+="[0-9]{0,1}";break;case "A":d+="[a-zA-Z]{1}";break;case "Z":d+="[a-zA-Z]{0,1}";break;default:d+="[]_\\(){}-.+*?".indexOf(c.charAt(e))!= !1?"\\"+c.charAt(e):c.charAt(e)}d="^"+d+"$";c=RegExp(d);$(this).val()!=""&&$(this).val()!=""&&c.test($(this).val())==!1&&f(this,"form_format")}});$(a).find("[class*=valVAT]").each(function(){$(this).attr("class").match(/valVAT\[([A-Za-z]+)\]/);if($(this).val()!=""&&RegExp.$1!=""&&x5engine.utils.isOnline()){var a=$(this);$.ajax({type:"GET",url:x5engine.imCart.settings.post_url+"?action=vat&vat="+escape(a.val())+"&country="+RegExp.$1,async:!1,cache:!1,success:function(b){b==="?(false)"&&f(a,"form_VAT")}})}}); $(a).find("input.valDisclaimer").each(function(){this.checked||f($(this),"form_err_disclaimer")});$(a).find("[class*=imCpt]").not("iframe").each(function(){x5engine.imForm.checkCaptcha($(this))||(x5engine.imForm.showCaptcha(a),f($(this),"form_captcha"))});$(a).find("input[type=submit]").attr("disabled",!1).attr("value",e);$(a).find(g+"_fakebutton2").attr("disabled",!1).attr("value",h);$(a).find("[class*=valQuestion]").each(function(){var b=$(this).attr("class"),c=$(a).attr("action");b.match(/valQuestion\[([A-Za-z0-9]+)\]/); if(x5engine.utils.isOnline()){if(RegExp.$1!=""){var d=$(this);$.ajax({type:"POST",url:c,data:{action:"check_answer",id:RegExp.$1,answer:d.val()},async:!1,cache:!1,success:function(a){a==="0"&&f($(d),"form_question")}})}}else $("#"+$(this).attr("id")+"_offlineanswer").val().replace(/\"/g,"'").replace(/\</g,"<").replace(/\>/g,">")!=$(this).val().replace(/\"/g,"'").replace(/\</g,"<").replace(/\>/g,">")&&f($(this),"form_question")})})();return d},submit:function(a,b){x5engine.imForm.validate(a, b)&&(x5engine.utils.isOnline()?($(a).unbind("submit"),$(a).submit()):x5engine.utils.showOfflineMessage(b.offlineMessage))}},imAlertBox:function(a){a=a||{};a.link=a.link||x5engine.settings.imAlertBox.link;if(a.cookie==null)a.cookie=x5engine.settings.imAlertBox.cookie;a.position=a.position||x5engine.settings.imAlertBox.position;a.image=a.image||x5engine.settings.imAlertBox.image;a.sound=a.sound||x5engine.settings.imAlertBox.sound;var b='<div id="imAlertBox"><div style="text-align: center; overflow: hidden;" class="imgContainer"><a href="'+ a.link+'"><img class="imAdvTarget"/></a></div><div class="closeAlBox"><img src="res/imClose.png" style="width: 20px;" /></div></div>',d=function(){$("#imAlertBox_fake").height($("#imAlertBox").outerHeight())};a.position=a.position||x5engine.settings.imAlertBox.position;a.sound=a.sound||x5engine.settings.imAlertBox.sound;a.image=a.image||x5engine.settings.imAlertBox.image;if(a.cookie&&$.imCookie("im_alert")=="true"&&x5engine.utils.isOnline())return!1;if(a.position=="top"){$("body").prepend(b);var c= $("#imAlertBox");c!=null&&(c.slideUp(0),c.addClass("alertBox"),b=function(){x5engine.utils.imSoundLink.Stop();c.slideUp(500,function(){c.remove()});$("#imAlertBox_fake").slideUp(500)},$("#imAlertBox img.imAdvTarget").load(function(){$("body").prepend('<div id="imAlertBox_fake"></div>');d();$("#imAlertBox_fake").slideUp(0);$("#imAlertBox_fake").css({position:"relative",right:0,left:0,top:0});$(this).unbind("load");$("#imAlertBox").css({position:"absolute",right:0,left:0,top:0,zIndex:x5engine.settings.zIndex.splashBox, "border-top-width":0});a.sound!=""&&a.sound!=null&&x5engine.utils.imSoundLink.Play(a.sound);$("#imAlertBox_fake").slideDown(500);c.slideDown(500);a.cookie&&$.imCookie("im_alert","true",{expires:0,path:"/"})}),$("#imAlertBox img.imAdvTarget").mouseenter(function(){$("#imAlertBox img.imAdvTarget").attr("src",a.image);$("#imAlertBox img.imAdvTarget").mouseleave(function(){$("#imAlertBox img.imAdvTarget").attr("src",a.image);$("#imAlertBox img.imAdvTarget").unbind("mouseleave")})}),$("#imAlertBox img.imAdvTarget").attr("src", a.image),$(".closeAlBox").click(b),a.callback!=null&&($("#imAlertBox .boxText").css("cursor","pointer"),$("#imAlertBox .boxText").click(a.callback)),$(window).unbind("resize",d).resize(d))}else if($("body").append(b),c=$("#imAlertBox"),c!=null){c.addClass("alertBox");c.css({position:"fixed",bottom:-1E3,left:0,right:0,zIndex:x5engine.settings.zIndex.splashBox+1});var b=function(){x5engine.utils.imSoundLink.Stop();c.animate({bottom:-$("#imAlertBox img").outerHeight(),height:$("#imAlertBox img").outerHeight()}, {duration:500,complete:function(){c.remove()}})},e=function(){$("#imAlertBox img.imAdvTarget").unbind("load");$("#imAlertBox img.imAdvTarget").load(function(){$("#imAlertBox .imgContainer").animate({height:$("#imAlertBox img.imAdvTarget").outerHeight()});c.animate({height:$("#imAlertBox img.imAdvTarget").outerHeight()});$("#imAlertBox img.imAdvTarget").mouseleave(h)});$("#imAlertBox img.imAdvTarget").attr("src",a.img_big)},h=function(){$("#imAlertBox img.imAdvTarget").unbind("load");$("#imAlertBox img.imAdvTarget").attr("src", a.image);$("#imAlertBox .imgContainer").animate({height:$("#imAlertBox img.imAdvTarget").outerHeight()});c.animate({height:$("#imAlertBox img.imAdvTarget").outerHeight()});$("#imAlertBox img.imAdvTarget").unbind("mouseleave")};$("#imAlertBox img.imAdvTarget").load(function(){$(this).unbind("load");a.sound!=""&&a.sound!=null&&x5engine.utils.imSoundLink.Play(a.sound);c.css({bottom:-$("#imAlertBox img").outerHeight(),"border-bottom-width":0});$("#imAlertBox .imgContainer").css({height:$("#imAlertBox img.imAdvTarget").outerHeight()}); c.stop(!0,!0);c.animate({bottom:0,height:$("#imAlertBox img.imAdvTarget").outerHeight()},{duration:500});a.cookie&&$.imCookie("im_alert","true",{expires:0})});a.img_big!=""&&$("#imAlertBox img.imAdvTarget").mouseenter(e);$("#imAlertBox img.imAdvTarget").attr("src",a.image);$(".closeAlBox").click(b);a.callback!=null&&($("#imAlertBox .boxText").css("cursor","pointer"),$("#imAlertBox .boxText").click(a.callback))}},imShowBox:{_create:function(a,b,d){var c=b||0,e=a.loadingImg||"imLoad.gif",h=a.closeImg|| "imClose.png",g=a.effect=="none"?0:350,f=a.opacity,j,l=!1,i=null,k=!1,o=function(){$("#imSB").css("backgroundImage","url('"+e+"')")},p=function(){$("#imSB").css("background-image","url('')")},r=function(b){var c=g,d=a.background||"black";if(d=="none"||d=="transparent")f=0.01,d="#ffffff";$("#imSB").width()!=null?$("#imSB").before('<div id="imSBBG"> </div>'):$("body").append('<div id="imSBBG"> </div>');a.effect=="none"&&(c=0);$("#imSBBG").fadeOut(0);$("#imSBBG").css({backgroundColor:d,position:"fixed", top:0,left:0,zIndex:x5engine.settings.zIndex.showBox,width:$(window).width(),height:$(window).height()});a.radialBg&&(/Firefox/.test(navigator.userAgent)?$("#imSBBG").css({"background-image":"-moz-radial-gradient(center 45deg, ellipse farthest-corner, "+x5engine.utils.hex2rgb(d,80,80,80)+" 0%, "+x5engine.utils.hex2rgb(d,40,40,40)+" 40%, "+x5engine.utils.hex2rgb(d)+" 100%)"}):/Chrome/.test(navigator.userAgent)&&$("#imSBBG").css({background:"-webkit-gradient(radial, 50% 50%, 0, 50% 50%, 500, from("+ x5engine.utils.hex2rgb(d,80,80,80)+"), to("+x5engine.utils.hex2rgb(d)+"))"}));$("#imSBBG").fadeTo(c,f,function(){b!=null&&b();$("#imSBBG").click(q);$("#imSBBG").mousemove(function(){k=!1})})},q=function(){p();/MSIE 7/.test(navigator.userAgent)==!1&&($("#imSB").css("box-shadow",""),$("#imSB").css("-webkit-box-shadow",""),$("#imSB").css("-moz-box-shadow",""));$("#imClose").remove();$("#imDes").remove();$("#imNext").remove();$("#imPrev").remove();$(document).unbind("keydown",v);a.media[c].type!="img"&& $("#imSBmedia").empty();if(a.effect=="fade"||a.effect=="none")$("#imSB").fadeOut(g,function(){$("#imSBBG").remove();$("#imSB").remove()});else if(a.effect=="move")$("#imSB").animate({top:-$("#imSB").height()-100},g/2,null,function(){$("#imSBBG").remove();$("#imSB").remove()});else if(a.effect=="zoom"||a.effect=="hide")if(l)$("#imSB").fadeOut(g),$("#imSBmedia").fadeOut(g,function(){$("#imSBBG").remove();$("#imSB").remove()}),$(d).css("visibility")!="visible"&&$(d).fadeOut(1,function(){$(d).css("visibility", "visible");$(d).fadeIn(g)});else{var b=$(d).offset();b.left-=$(window).scrollLeft();b.top-=$(window).scrollTop();$("#imSBmedia img, #imSBmedia").css("width","100%");if(a.media[c].type=="img"){var e=$("#imSBmedia").clone();e.attr("id","imSBmedia2");e.find("img").attr("src",$(d).attr("src"));e.css({position:"absolute",top:0,left:0});$("#imSBmedia").before(e);e.fadeOut(0);e.fadeIn(g);$("#imSBmedia").fadeOut(g)}$("#imSB").animate({borderWidth:0,left:b.left,top:b.top,width:$(d).width(),margin:0,padding:0, height:$(d).height()},g,function(){$(d).css("visibility","visible");$("#imSBBG").remove();$("#imSB").remove()})}$(window).unbind("resize",n);$("#imSBBG").fadeOut(g);$("body").unbind("keypress",A)},n=function(){j!=null&&clearTimeout(j);j=setTimeout(m,200);$("#imSB").width()!==null&&($("#imSBBG").width($(document).width()),$("#imSBBG").height($(document).height()))},w=function(b,c,d,e){$("#imSBBG").width()!=null?$("#imSBBG").after('<div id="imSB"><div id="imSBmedia"></div><div id="imDes"></div></div>'): $("body").append('<div id="imSB"><div id="imSBmedia"></div><div id="imDes"></div></div>');a.effect!="none"&&$("#imSB").fadeOut(0);$("#imSB").css({top:c,left:b,width:d,height:e,padding:a.innerBorder,zIndex:x5engine.settings.zIndex.showBox+1,backgroundColor:a.boxColor});$("#imSB #imDes").css("color",a.textColor);$("#imSB").css("-moz-border-radius","10px");$("#imSB").css("-webkit-border-radius","10px");$("#imSB").css("border-radius","10px");return $("#imSB")},B=function(){/MSIE 7/.test(navigator.userAgent)== !1&&($("#imSB").css("box-shadow","0px 3px 7px #000"),$("#imSB").css("-webkit-box-shadow","0px 3px 7px #000"),$("#imSB").css("-moz-box-shadow","0px 3px 7px #000"))},F=function(){p();$("#imSBmedia img").unbind("load");$("#imSBmedia").empty().append("File not found").fadeIn()},u=function(){o();$("#imSBBG").click(q);k=$("#imNext:visible").length>0&&$("#imPrev:visible").length>0?!0:!1;G();$("#imDes:visible").length>0&&$("#imDes:visible").html()!=""?$("#imDes").fadeOut(g):$("#imDes").fadeOut(0);$("#imSB #imClose").fadeOut(g+ 1,function(){$("#imSB #imClose").remove()});$("#imSBmedia").length==0&&($("#imSB object").remove(),$("#imSB").prepend('<div id="imSBmedia"></div>'));$("#imSBmedia").fadeOut($("#imSBmedia").html()==""?1:g+1,function(){$("#imDes").empty();a.media[c].text!=""?($("#imDes").append(a.media[c].text.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<")),$("#imDes").height("auto")):$("#imDes").fadeOut(0);$("#imSBmedia").empty();switch(a.media[c].type){case "img":$("#imSBmedia").append("<img />"); a.effect!="none"&&$("#imSBmedia img").fadeOut(0);a.effect!="zoom"&&a.effect!="hide"||l?$("#imSBmedia img").load(m):$("#imSBmedia img").load(t);$("#imSBmedia img").error(F);$("#imSBmedia img").attr("src",a.media[c].url);break;case "video":a.effect!="zoom"&&a.effect!="hide"||l?m(function(){$("#imSBmedia").append('<embed src="'+a.media[c].url+'" width="'+a.media[c].width+'" height="'+a.media[c].height+'" autostart="true"></embed>')}):t(function(){$("#imSBmedia").append('<embed src="'+a.media[c].url+ '" width="'+a.media[c].width+'" height="'+a.media[c].height+'" autostart="true"></embed>')});break;case "swf":a.effect!="zoom"&&a.effect!="hide"||l?m(function(){$("#imSBmedia").append('<embed src="'+a.media[c].url+'" type="application/x-shockwave-flash" width="'+a.media[c].width+'" height="'+a.media[c].height+'" wmode="opaque" menu="false" quality="high"></embed>')}):t(function(){$("#imSBmedia").append('<embed src="'+a.media[c].url+'" type="application/x-shockwave-flash" width="'+a.media[c].width+ '" height="'+a.media[c].height+'" wmode="opaque" menu="false" quality="high"></embed>')});break;case "iframe":a.effect!="zoom"&&a.effect!="hide"||l?m(function(){$("#imSBmedia").append('<iframe src="'+a.media[c].url+'" width="'+a.media[c].width+'" height="'+a.media[c].height+'" frameborder="0" marginwidth="0" marginheight="0"></iframe>')}):t(function(){$("#imSBmedia").append('<iframe src="'+a.media[c].url+'" width="'+a.media[c].width+'" height="'+a.media[c].height+'" frameborder="0" marginwidth="0" marginheight="0"></iframe>')}); break;case "code":var b=a.media[c].content,b=b.replace(/&/g,"&"),b=b.replace(/</g,"<"),b=b.replace(/>/g,">"),b=b.replace(/"/g,'"');a.effect!="zoom"&&a.effect!="hide"||l?m(function(){$("#imSBmedia").append(b);setTimeout(function(){try{$("#imSB").unbind("mousemove",s),$("#imSB").mousemove().mouseleave(),$("#imSB").mousemove(s)}catch(a){}},1E3)}):t(function(){$("#imSBmedia").append(b);setTimeout(function(){try{$("#imSB").unbind("mousemove",s),$("#imSB").mousemove().mouseleave(),$("#imSB").mousemove(s)}catch(a){}}, 1E3)})}})},x=function(b){var c=a.media[b].width,d,e;$("#imDes").width(c);d=a.media[b].height;$("#imDes").html()!=""&&(d+=$("#imDes").height());a.media[b].type=="img"&&($("#imSBmedia img").fadeIn(0),$("#imSBmedia img").width(""),$("#imSBmedia img").height(""));$("#imSBmedia").width("");$("#imSBmedia").height("");c+2*a.border+2*a.innerBorder>$(window).width()-50&&(d=d*($(window).width()-50-2*a.border-2*a.innerBorder)/c,c=$(window).width()-50-2*a.border-2*a.innerBorder,$("#imDes").width(c),$("#imDes").html()!= ""&&(d+=$("#imDes").height()));if(d+2*a.border+2*a.innerBorder>$(window).height()-50){var f=$("#imDes").outerHeight(),c=c*($(window).height()-50-2*a.border-2*a.innerBorder)/d;e=d=$(window).height()-50-2*a.border-2*a.innerBorder;$("#imDes").html()!=""&&(e-=$("#imDes").height());$("#imDes").width(Math.round(a.media[b].width*e/a.media[b].height));$("#imDes").height()<=f&&(c=Math.round(a.media[b].width*e/a.media[b].height));$("#imDes").width("")}return[c,d,null]},m=function(b){$("#imSBmedia img").length> 0&&$("#imSBmedia img").unbind("load");$("#imSB").css({padding:a.innerBorder});$("#imDes").fadeOut($("#imSBmedia").html()==""?1:g+1);$("#imSBmedia").fadeOut($("#imSBmedia").html()==""?1:g+1,function(){var d=x(c),e=g;$("#imSBmedia img").width("100%");$("#imSB").width()==d[0]&&$("#imSB").height()==d[1]&&(e=1);$("#imSB").width()>d[0]&&(k=!1);$("#imSB").animate({left:Math.round(($(window).width()-d[0]-2*a.innerBorder-2*a.border)/2),width:d[0]},e,function(){$("#imSB").animate({top:Math.round(($(window).height()- d[1]-2*a.innerBorder-2*a.border)/2),height:d[1]},e,function(){p();$("#imSBmedia").fadeIn(g+1,function(){k&&s()});$("#imDes").html()!=""&&$("#imDes").fadeIn(g);C();a.media.length>1&&D();a.shadow&&B();$(window).unbind("resize",n).resize(n);$(document).unbind("keydown",v).keydown(v);b!=null&&$.isFunction(b)&&b()})})})},t=function(b){$("#imSBmedia img").unbind("load");var e=x(c);p();$("#imSBmedia").css({width:"100%",textAlign:"center"});$("#imSBmedia img").css({width:"100%"});$("#imSB").fadeIn(0);$("#imSBmedia").fadeOut(1); a.effect=="hide"&&$(d).css("visibility","hidden");$("#imSB").css("background-color",a.boxColor);r();var f=$("#imSBmedia").clone(!1);f.attr("id","fakeSBImg");f.find("img").attr("src",$(d).attr("src"));f.css({position:"absolute",top:0,left:0});$("#imSB").prepend(f);f.fadeIn(0);f.fadeOut(g,function(){f.remove()});$("#imSBmedia").fadeIn(g);$("#imSB").animate({left:Math.round(($(window).width()-e[0]-2*a.innerBorder-2*a.border)/2),width:e[0],padding:a.innerBorder,top:Math.round(($(window).height()-e[1]- 2*a.innerBorder-2*a.border)/2),height:e[1],borderWidth:a.border},g,function(){$("#imDes").html()!=""&&$("#imDes").fadeIn(g);$("#imSB").css("border-width",a.border);C();k&&s();a.media.length>1&&D();a.shadow&&B();$(window).unbind("resize",n).resize(n);b!=null&&$.isFunction(b)&&b()})},C=function(){$("#imSB").append('<div id="imClose"><img src="'+h+'" /></div>');$("#imSB #imClose img").click(q)},D=function(){$("#imPrev").remove();$("#imNext").remove();$("#imSB").append('<div id="imPrev"><</div><div id="imNext">></div>'); $("#imPrev").fadeOut(0);$("#imNext").fadeOut(0);$("#imPrev").click(y);$("#imNext").click(z);$("#imSB").unbind("mouseleave");$("#imSB").unbind("mousemove");$("#imSB").mouseleave(function(){i!=null&&clearTimeout(i);i=setTimeout(function(){$("#imNext").stop(!0,!0);$("#imPrev").stop(!0,!0);$("#imNext").fadeOut(g);$("#imPrev").fadeOut(g)},g/2)});$("#imSB").mousemove(s)},G=function(){$("#imPrev").fadeOut(g,function(){$("#imPrev").remove()});$("#imNext").fadeOut(g,function(){$("#imNext").remove()})},E=function(){$("#imNext").css({"-moz-border-top-left-radius":0, "-moz-border-top-right-radius":10,"-moz-border-bottom-right-radius":10,"-moz-border-bottom-left-radius":0,"-webkit-border-top-left-radius":0,"-webkit-border-top-right-radius":10,"-webkit-border-bottom-right-radius":10,"-webkit-border-bottom-left-radius":0,"border-top-left-radius":0,"border-top-right-radius":10,"border-bottom-right-radius":10,"border-bottom-left-radius":0});$("#imPrev").css({"-moz-border-top-left-radius":10,"-moz-border-top-right-radius":0,"-moz-border-bottom-right-radius":0,"-moz-border-bottom-left-radius":10, "-webkit-border-top-left-radius":10,"-webkit-border-top-right-radius":0,"-webkit-border-bottom-right-radius":0,"-webkit-border-bottom-left-radius":10,"border-top-left-radius":10,"border-top-right-radius":0,"border-bottom-right-radius":0,"border-bottom-left-radius":10})},v=function(a){if(!$("#imSB").is(":animated"))switch(a.keyCode){case 32:case 39:z();break;case 37:y()}switch(a.keyCode){case 27:q()}},s=function(){i!=null&&clearTimeout(i);var b=$("#imSB").outerHeight()/2-$("#imPrev").outerHeight()/ 2,d;$("#imSB").width()-a.innerBorder*2>$("#imPrev").width()*2?(d=a.innerBorder,$("#imPrev").css({"-moz-border-top-left-radius":0,"-moz-border-top-right-radius":10,"-moz-border-bottom-right-radius":10,"-moz-border-bottom-left-radius":0,"-webkit-border-top-left-radius":0,"-webkit-border-top-right-radius":10,"-webkit-border-bottom-right-radius":10,"-webkit-border-bottom-left-radius":0,"border-top-left-radius":0,"border-top-right-radius":10,"border-bottom-right-radius":10,"border-bottom-left-radius":0}), $("#imNext").css({"-moz-border-top-left-radius":10,"-moz-border-top-right-radius":0,"-moz-border-bottom-right-radius":0,"-moz-border-bottom-left-radius":10,"-webkit-border-top-left-radius":10,"-webkit-border-top-right-radius":0,"-webkit-border-bottom-right-radius":0,"-webkit-border-bottom-left-radius":10,"border-top-left-radius":10,"border-top-right-radius":0,"border-bottom-right-radius":0,"border-bottom-left-radius":10})):(d=-$("#imPrev").width(),E());a.media[c].type!="iframe"&&a.media[c].type!= "img"&&(d=-$("#imPrev").width(),E());$("#imPrev").css({top:b,left:d});$("#imNext").css({top:b,right:d});$("#imPrev").fadeIn(g);$("#imNext").fadeIn(g)},z=function(){l=!0;c++;c>=a.media.length&&(c=0);u(c)},y=function(){l=!0;c--;c<0&&(c=a.media.length-1);u(c)},A=function(a){switch(a.keyCode){case 37:case 40:a.preventDefault();y();break;case 39:case 38:a.preventDefault();z();break;case 27:a.preventDefault(),q()}};this.showBox=function(){var b;r(function(){a.effect=="none"||a.effect=="fade"?(b=w(Math.round($(window).width()/ 2-50),Math.round($(window).height()/2-50),100,100),o(),b.fadeIn(g,function(){u(c)})):a.effect=="move"&&(b=w(Math.round($(window).width()/2-50),-100,100,100),b.fadeIn(0),b.animate({top:Math.round($(window).height()/2-50)},g/2,function(){u(c);o()}))})};this.zoomBox=function(){x(c);var b;$(d).find("img").is("img")&&(d=$(d).find("img"));try{b=$(d).offset(),b.left-=$(window).scrollLeft(),b.top-=$(window).scrollTop(),box=w(b.left,b.top,$(d).width(),$(d).height()),box.css("padding","0px"),box.css("border-width", "0px"),box.css("background-color","transparent"),o(),box.fadeIn(),u(c),$("body").keypress(A)}catch(e){a.effect="fade",this.showBox()}}},Show:function(a,b,d){a.effect=a.effect||x5engine.settings.imShowBox.effect;a.shadow=a.shadow||x5engine.settings.imShowBox.shadow;a.background=a.background||x5engine.settings.imShowBox.background;a.border=a.border||x5engine.settings.imShowBox.borderRadius;a.textColor=a.textColor||x5engine.settings.imShowBox.textColor;a.boxColor=a.boxColor||x5engine.settings.imShowBox.boxColor; a.opacity=a.opacity||x5engine.settings.imShowBox.opacity;a.closeImg=a.closeImg||x5engine.settings.imShowBox.closeImg;a.loadingImg=a.loadingImg||x5engine.settings.imShowBox.loadingImg;a.innerBorder=a.innerBorder||x5engine.settings.imShowBox.innerBorder;a.radialBg=a.radialBg||x5engine.settings.imShowBox.radialBg;for(var c=[],e=0;e<a.media.length;e++)c[c.length]=a.media[e].url;x5engine.utils.imPreloadImages(c);$("#imSB").length==0&&(b=new x5engine.imShowBox._create(a,b,d),a.effect=="zoom"||a.effect== "hide"?b.zoomBox():b.showBox());return!1}},imDatePicker:function(a,b){var d,c=x5engine.l10n.getLocalization("date_months"),e=x5engine.l10n.getLocalization("date_full_months"),h=x5engine.l10n.getLocalization("date_days"),g=x5engine.l10n.getLocalization("date_full_days"),f=function(a,b){for(var c=[],d=!1,e=0;!d&&e<b.length;)a.indexOf(b.charAt(e))!=-1&&(d=!0),e++;if(!d||b.length==0)return[a];d=a.split(b.charAt(0));for(e=0;e<d.length;e++)c=c.concat(f(d[e],b.substring(1)));return c},j=function(){var c= $(a).val(),d=b.format;if(c!=""){format=d;format=format.replace(/\//g,"\\/");format=format.replace(/\s/g,"\\s+");format=format.replace(/\-/g,"\\-");format=format.replace(/\./g,"\\.");format=format.replace(/\[dd\]/g,"\\d{1,2}");format=format.replace(/\[mm\]/g,"\\d{1,2}");format=format.replace(/\[yy\]/g,"\\d{2}");format=format.replace(/\[yyyy\]/g,"\\d{4}");format=format.replace(/\[DD\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+");format=format.replace(/\[MM\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+"); format=format.replace(/\[D\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+");format=format.replace(/\[M\]/g,"[\\w\u00ec\u00f2\u00e0\u00f9\u00e8\u00e9']+");format="^"+format+"$";if(!RegExp(format).test(c))return!1;for(var d=d.replace("[M]",""),d=d.replace("[D]",""),d=d.replace("[MM]",""),d=d.replace("[DD]",""),d=d.replace("[yy]",""),d=d.replace("[yyyy]",""),d=d.replace("[mm]",""),d=d.replace("[dd]",""),e=f(b.format,d),c=f(c,d),g=d="",h="",j=0;j<e.length;j++)switch(e[j]){case "[M]":for(var i=x5engine.l10n.getLocalization("date_months"), k=0;k<i.length;k++)i[k].toLowerCase()==c[j].toLowerCase()&&(d=k+1);break;case "[MM]":i=x5engine.l10n.getLocalization("date_full_months");for(k=0;k<i.length;k++)i[k].toLowerCase()==c[j].toLowerCase()&&(d=k+1);break;case "[D]":i=x5engine.l10n.getLocalization("date_days");for(k=0;k<i.length;k++)i[k].toLowerCase()==c[j].toLowerCase()&&(g=k+1);break;case "[DD]":i=x5engine.l10n.getLocalization("date_full_days");for(k=0;k<i.length;k++)i[k].toLowerCase()==c[j].toLowerCase()&&(g=k+1);break;case "[yy]":h="20"+ c[j];break;case "[yyyy]":h=c[j];break;case "[mm]":d=c[j];break;case "[dd]":g=c[j]}return new Date(h,d-1,g)}return!1},l=function(){var a="<table>",c;a+="<tr>";for(var e=0;e<h.length;e++)c=e+b.start,c>6&&(c-=7),a+='<td class="imDPhead">'+h[c]+"</td>";a+="</tr>";c=new Date(b.date.getYear(),b.date.getMonth(),b.date.getDate());c.setFullYear(b.date.getFullYear());c.setDate(1);var f=parseInt(c.getDay(),10);f-=b.start;f<=0&&(f+=7);for(var g=parseInt(c.getMonth(),10),j=0;c.getMonth()==g;){a+="<tr>";for(e= 1;e<=7;e++){var i="day";if(e+7*j>=f&&c.getMonth()==g){var k=e-f+1+7*j;k==d.getDate()&&c.getMonth()==d.getMonth()&&(i+=" selDay");a+='<td class="'+i+'">'+k+"</td>";c.setDate(c.getDate()+1)}else a+="<td></td>"}a+="</tr>";j++}a+="</table>";return a},i=function(f,j){j==null||j==!1?(b.date.setDate($(this).html()),d.setFullYear(b.date.getFullYear()),d.setMonth(b.date.getMonth()),d.setDate($(this).html())):(b.date.setFullYear(j.getFullYear()),b.date.setMonth(j.getMonth()),b.date.setDate(j.getDate()),d.setFullYear(j.getFullYear()), d.setMonth(j.getMonth()),d.setDate(j.getDate()));var i=b.date.getFullYear().toString(),k=x5engine.utils.imFormatInt(parseInt(b.date.getDate(),10)),l=x5engine.utils.imFormatInt(parseInt(b.date.getMonth(),10)+1),m=b.format.replace(/\[yyyy\]/g,i),m=m.replace(/\[yy\]/g,i.substring(2)),m=m.replace(/\[mm\]/g,l),m=m.replace(/\[dd\]/g,k),m=m.replace(/\[D\]/g,parseInt(d.getDay(),10)-1>=0?h[parseInt(d.getDay(),10)-1]:h[6]),m=m.replace(/\[DD\]/g,parseInt(d.getDay(),10)-1>=0?g[parseInt(d.getDay(),10)-1]:g[6]), m=m.replace(/\[M\]/g,c[parseInt(d.getMonth(),10)]),m=m.replace(/\[MM\]/g,e[parseInt(d.getMonth(),10)]);$(a).attr("value",m);q()},k=function(){b.date.setMonth(b.date.getMonth()+1);$("#imDPcal").empty().append(l());$("#imDPMonth").empty().append(e[parseInt(b.date.getMonth(),10)]+" "+b.date.getFullYear().toString());$(".day").click(i)},o=function(){b.date.setMonth(b.date.getMonth()-1);$("#imDPcal").empty().append(l());$("#imDPMonth").empty().append(e[parseInt(b.date.getMonth(),10)]+" "+b.date.getFullYear().toString()); $(".day").click(i)},p=function(a,c){var f=j();f!=null&&f!=!1&&(b.date.setFullYear(f.getFullYear()),b.date.setMonth(f.getMonth()),b.date.setDate(f.getDate()),d.setFullYear(f.getFullYear()),d.setMonth(f.getMonth()),d.setDate(f.getDate()));f='<div id="imDatePicker">';f+='<div id="imDPHead"><span id="imDPleft"><</span><span id="imDPMonth"> </span><span id="imDPright">></span></div>';f+='<div id="imDPcal">'+l()+"</div>";f+="</div>";$("body").append('<div id="imDPBG"></div>');$("#imDPBG").css({position:"fixed", width:$(window).width(),height:$(window).height(),top:0,left:0,zIndex:x5engine.settings.zIndex.datePicker+1});$("#imDPBG").click(q);$("body").append(f);b.shadow==!0&&($("#imDatePicker").css("box-shadow","0px 0px 3px #000"),$("#imDatePicker").css("-webkit-box-shadow","0px 0px 3px #000"),$("#imDatePicker").css("-moz-box-shadow","0px 0px 3px #000"));$("#imDPMonth").append(e[parseInt(d.getMonth(),10)]+" "+d.getFullYear().toString());$("#imDPleft").click(o);$("#imDPright").click(k);$(".day").click(i); a+$("#imDatePicker").width()>$(window).width()+$(window).scrollLeft()&&(a=$(window).width()-$("#imDatePicker").outerWidth()-5+$(window).scrollLeft());c+$("#imDatePicker").height()>$(window).height()+$(window).scrollTop()&&(c=$(window).height()-$("#imDatePicker").outerHeight()-5+$(window).scrollTop());$("#imDatePicker").fadeOut(0);$("#imDatePicker").css({top:c,left:a});/IE 7/.test(navigator.userAgent)||($("#imDatePicker").css("-moz-border-radius","5px"),$("#imDatePicker").css("-webkit-border-radius", "5px"),$("#imDatePicker").css("border-radius","5px"),$("#imDatePicker #imDPHead").css("-moz-border-radius","5px"),$("#imDatePicker #imDPHead").css("-webkit-border-radius","5px"),$("#imDatePicker #imDPHead").css("border-radius","5px"),$("#imDatePicker #imDPHead").css("background","-webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(255,255,255)), color-stop(1, rgb(193,203,213)))"),$("#imDatePicker #imDPHead").css("background","-moz-linear-gradient( center bottom, rgb(255,255,255) 0%, rgb(193,203,213) 100%"), $("#imDatePicker .day").css("background","-webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(245,245,245)), color-stop(1, rgb(255,255,255)))"),$("#imDatePicker .day").css("background","-moz-linear-gradient( center bottom, rgb(245,245,245) 0%, rgb(255,255,255) 100%)"),$("#imDatePicker .selDay").css("background","-webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(255,240,128)), color-stop(1, rgb(255,255,255)))"),$("#imDatePicker .selDay").css("background","-moz-linear-gradient( center bottom, rgb(255,240,128) 0%, rgb(255,255,255) 100% )")); $("#imDatePicker").css({zIndex:x5engine.settings.zIndex.datePicker+2}).fadeIn(200)},r=function(a){$("#imDatePicker").length>0?$("#imDatePicker").fadeOut(200,function(){$("#imDatePicker").remove();p(a.pageX,a.pageY)}):p(a.pageX,a.pageY)},q=function(){$("#imDPBG").remove();$("#imDatePicker").fadeOut(200,function(){$("#imDatePicker").remove()})},b=b||{};if(b.icon==null)b.icon=!0;b.start=b.start||0;if(b.shadow==null)b.shadow=!0;b.start<0&&(b.start+=7);b.format=b.format||x5engine.l10n.getLocalization("date_format"); b.date=b.date==null||b.date==""||b.date=="undefined"?new Date:new Date(b.date.substring(6),parseInt(b.date.substring(3,5),10)-1,b.date.substring(0,2));d=new Date(b.date.getFullYear(),b.date.getMonth(),b.date.getDate());if(b.icon){var n=document.createElement("span"),n=$(n);$(a).after(n);n.empty().append('<img src="res/date.gif" style="cursor: pointer;" class="imDatePickerIcon"/>');n.find("img").css({marginTop:Math.floor(n.prev("input").outerHeight()-15)/2+1});n.click(r)}else $(a).click(r);$(a).bind("change", function(){var a=j();a!=!1&&i(null,a)})},imDate:function(a,b,d){var b=b||x5engine.l10n.getLocalization("date_days"),d=d||x5engine.l10n.getLocalization("date_months"),c=x5engine.l10n.getLocalization("date_full_months"),e=x5engine.l10n.getLocalization("date_full_days"),h=x5engine.l10n.getLocalization("date_format"),g=new Date,f=g.getFullYear().toString(),j=x5engine.utils.imFormatInt(parseInt(g.getDate(),10)),l=x5engine.utils.imFormatInt(parseInt(g.getMonth(),10)+1),i="";try{i=h.replace(/\[yyyy\]/g, f),i=i.replace(/\[yy\]/g,f.substring(2)),i=h.replace(/\[aaaa\]/g,f),i=i.replace(/\[aa\]/g,f.substring(2)),i=i.replace(/\[mm\]/g,l),i=i.replace(/\[dd\]/g,j),i=i.replace(/\[D\]/g,parseInt(g.getDay(),10)-1>=0?b[parseInt(g.getDay(),10)-1]:b[6]),i=i.replace(/\[DD\]/g,parseInt(g.getDay(),10)-1>=0?e[parseInt(g.getDay(),10)-1]:e[6]),i=i.replace(/\[M\]/g,d[parseInt(g.getMonth(),10)]),i=i.replace(/\[MM\]/g,c[parseInt(g.getMonth(),10)])}catch(k){}$(a).empty().append(i);setTimeout("x5engine.imDate('"+a+"')", 6E4)},imHour:function(a){var b=new Date;$(a).empty().append(x5engine.utils.imFormatInt(b.getHours())+":"+x5engine.utils.imFormatInt(b.getMinutes())+":"+x5engine.utils.imFormatInt(b.getSeconds())+" ");setTimeout("x5engine.imHour('"+a+"')",1E3)},imKeys:{Replace:function(a,b){for(var d=$(a).find(),c=0;c<d.length;c++)x5engine.imKeys.Replace(d[c],b);for(c=0;c<b.length;c++)$.isFunction(b[c].r)?$(a).html($(a).html().replace(b[c].f,b[c].r())):$(a).html($(a).html().replace(b[c].f,b[c].r))},Set:function(a){x5engine.imKeys.Replace($("body"), a);x5engine.imDate(".imDate",x5engine.l10n.getLocalization("date_days"),x5engine.l10n.getLocalization("date_months"));x5engine.imHour(".imHour")}},imRollover:function(a){a.movement=a.movement||"ALTERNATE";a.direction=a.direction||"UP";a.effect=a.effect||"LINEAR";var b,d=null,c=a.time,e=null,h=0;switch(a.effect){case "SWING":b="swing";break;case "BOUNCE":b="imBounce";break;default:b="linear"}var g=$("#"+a.id),f,j=function(k){k==null&&(k=!0);k&&(h=0);e!=null&&clearInterval(e);e=setInterval(function(){h+= 10},10);a.time=c-h/1E3;if(a.time<=0)a.time=c;switch(a.movement){case "PAGINATE":switch(a.direction){case "UP":k=f.css("top").replace("px","");k=isNaN(parseInt(k))?0:parseInt(k);k>a.height-f.height()?f.animate({top:k-a.height},{duration:"medium",complete:function(){d=setTimeout(function(){j()},a.time*1E3)},easing:b}):f.animate({top:0},{duration:"medium",complete:function(){d=setTimeout(function(){j()},a.time*1E3)},easing:b});break;case "BOTTOM":k=f.css("top").replace("px","");k=isNaN(parseInt(k))? 0:parseInt(k);k<=0?f.animate({top:k+a.height},{duration:"medium",complete:function(){d=setTimeout(function(){j()},a.time*1E3)},easing:b}):f.animate({top:a.height-f.height()},{duration:"medium",complete:function(){d=setTimeout(function(){j()},a.time*1E3)},easing:b});break;case "LEFT":k=f.css("left").replace("px","");k=isNaN(parseInt(k))?0:parseInt(k);k>-f.width()+g.width()?f.animate({left:k-g.width()},{duration:"medium",complete:function(){d=setTimeout(function(){j()},a.time*1E3)},easing:b}):f.animate({left:0}, {duration:"medium",complete:function(){d=setTimeout(function(){j()},a.time*1E3)},easing:b});break;case "RIGHT":k=f.css("left").replace("px",""),k=isNaN(parseInt(k))?0:parseInt(k),k<0?f.animate({left:k+g.width()},{duration:"medium",complete:function(){setTimeout(function(){j()},a.time*1E3)},easing:b}):f.animate({left:-f.width()+g.width()},{duration:"medium",complete:function(){setTimeout(function(){j()},a.time*1E3)},easing:b})}break;case "CONTINUE":switch(a.direction){case "UP":f.animate({top:-f.height()}, {duration:a.time*1E3,complete:function(){f.css({top:a.height});j()},easing:b});break;case "BOTTOM":f.animate({top:a.height},{duration:a.time*1E3,complete:function(){f.css({top:-f.height()});j()},easing:b});break;case "LEFT":f.animate({left:-f.width()},{duration:a.time*1E3,complete:function(){f.css({left:g.width()});j()},easing:b});break;case "RIGHT":f.animate({left:g.width()},{duration:a.time*1E3,complete:function(){f.css({left:-f.width()});j()},easing:b})}break;case "SINGLE":switch(a.direction){case "UP":f.animate({top:0}, {duration:a.time*1E3,easing:b});break;case "BOTTOM":f.animate({top:-f.height()+a.height},{duration:a.time*1E3,easing:b});break;case "LEFT":f.animate({left:-i+g.width()},{duration:a.time*1E3,easing:b});break;case "RIGHT":f.animate({left:0},{duration:a.time*1E3,easing:b})}break;default:switch(a.direction){case "UP":f.animate({top:0},{duration:a.time*1E3,complete:function(){a.direction="BOTTOM";j()},easing:b});break;case "BOTTOM":f.animate({top:-f.height()+a.height},{duration:a.time*1E3,complete:function(){a.direction= "UP";j()},easing:b});break;case "LEFT":f.animate({left:-i+g.width()},{duration:a.time*1E3,complete:function(){a.direction="RIGHT";j()},easing:b});break;case "RIGHT":f.animate({left:0},{duration:a.time*1E3,complete:function(){a.direction="LEFT";j()},easing:b})}}},l=function(a){$("body").append('<div id="widthTest"><div id="widthTestSpan">'+a+"</div></div>");var a=$("#widthTest"),b=$("#widthTestSpan");a.css({width:"50000000px",position:"absolute"});b.css({width:"auto",position:"absolute",display:"inline"}); b=b.width();a.remove();return b};g.wrapInner('<div id="'+a.id+'_runner">');f=$("#"+a.id+"_runner");g.css({position:"relative",overflow:"hidden"});f.css({position:"absolute"});a.mouselock&&a.movement!="PAGINATE"?(g.mouseenter(function(){e!=null&&clearInterval(e);f.stop()}),g.mouseleave(function(){j(!1)})):a.mouselock&&a.movement=="PAGINATE"&&(g.mouseover(function(){d!=null&&clearTimeout(d)}),g.mouseleave(function(){d=setTimeout(function(){j(!1)},a.time*1E3)}));switch(a.movement){case "CONTINUE":switch(a.direction){case "UP":f.css({top:a.height}); break;case "BOTTOM":f.css({top:-f.height()});break;case "LEFT":f.css({left:g.width()});var i=l(f.html());f.css({width:i});break;case "RIGHT":f.css({left:-f.width()}),i=l(f.html()),f.css({left:-i+g.width(),width:i})}break;case "PAGINATE":switch(a.direction){case "BOTTOM":f.css({top:-f.height()+a.height});break;case "UP":f.css({top:0});break;case "RIGHT":i=l(f.html());f.css({left:-i+g.width(),width:i});break;case "LEFT":i=l(f.html()),f.css({left:0,width:i})}break;default:switch(a.direction){case "UP":f.css({top:-f.height()+ a.height});break;case "BOTTOM":f.css({top:0});break;case "RIGHT":i=l(f.html());f.css({left:-i+g.width(),width:i});break;case "LEFT":i=l(f.html()),f.css({left:0,width:i})}}a.movement!="PAGINATE"?j():d=setTimeout(function(){j()},a.time*1E3)},imSplashBox:function(a){a.effect=a.effect||x5engine.settings.imSplashBox.effect;a.position=a.position||x5engine.settings.imSplashBox.position;if(a.shadow==null)a.shadow=x5engine.settings.imSplashBox.shadow;a.margin=a.margin||x5engine.settings.imSplashBox.margin; a.width=a.width||x5engine.settings.imSplashBox.width;a.height=a.height||x5engine.settings.imSplashBox.height;a.cookie=a.cookie||x5engine.settings.imSplashBox.cookie;a.link=a.link||x5engine.settings.imSplashBox.link;a.image=a.image||x5engine.settings.imSplashBox.image;a.sound=a.sound||x5engine.settings.imSplashBox.sound;if(a.cookie&&$.imCookie("im_splash")=="true"&&x5engine.utils.isOnline())return!1;var b,d=function(){switch(a.position){case "center":b={left:($(window).width()-cWidth)/2,top:($(window).height()- cHeight)/2};break;case "bottom-right":b={left:$(window).width()-cWidth-a.margin,top:$(window).height()-cHeight-a.margin};break;case "bottom-left":b={left:a.margin,top:$(window).height()-cHeight-a.margin};break;case "top-right":b={left:$(window).width()-cWidth-a.margin,top:a.margin};break;case "top-left":b={left:a.margin,top:a.margin}}e.css(b)},c=function(){e.fadeOut(200,function(){e.remove();x5engine.utils.imSoundLink.Stop()})};$("body").append('<div id="imSplashBox"><div style="text-align: right; "><div id="imClose"><img src="res/imClose.png" /></div></div><div id="splashContent" style="overflow: hidden;"><img /></div></div>'); a.sound!=""&&a.sound!=null&&x5engine.utils.imSoundLink.Play(a.sound);var e=$("#imSplashBox");e.fadeOut(0);e.css({zIndex:x5engine.settings.zIndex.splashBox});a.shadow&&(e.css("box-shadow","0px 3px 7px #000"),e.css("-webkit-box-shadow","0px 3px 7px #000"),e.css("-moz-box-shadow","0px 3px 7px #000"));$("#splashContent img").first().load(function(){setTimeout(function(){$(this).unbind("load");e.fadeIn(0);cWidth=$("#imSplashBox").outerWidth();cHeight=$("#imSplashBox").outerHeight();e.fadeOut(0);d();$(window).resize(d); $("#imClose img").click(c);$("#splashContent img").click(function(){location.href=a.link});a.cookie&&$.imCookie("im_splash","true",{expires:0});switch(a.effect){case "fromtop":e.css({top:-$(window).height()-cHeight});e.fadeIn(0);e.animate(b,500);break;case "frombottom":e.css({top:$(window).height()+cHeight});e.fadeIn(0);e.animate(b,500);break;case "fromleft":e.css({left:-cWidth});e.fadeIn(0);e.animate(b,500);break;case "fromright":e.css({left:cWidth+$(window).width()});e.fadeIn(0);e.animate(b,500); break;case "fade":e.fadeIn(500);break;default:e.fadeIn(0)}},500)});$("#splashContent img").attr("src",a.image)},imSlider:{Horizontal:function(a){var b=$(a+" .imGlContent"),d=$(a+" .imRunner");$(a);var c=0;$(a+" .imLeftArrow").click(function(){c+b.innerWidth()>=20?c=d.innerWidth()%b.innerWidth()==0?-d.innerWidth()+b.innerWidth():-d.innerWidth()+d.innerWidth()%b.innerWidth():c+=b.innerWidth();d.animate({left:c})});$(a+" .imRightArrow").click(function(){-c<d.width()-b.innerWidth()?c-=b.innerWidth(): c=0;d.animate({left:c})})},Vertical:function(a){var b=$(a+" .imGlContent"),d=$(a+" .imRunner");$(a);var c=0;d.css({marginTop:-5});$(a+" .imTopArrow").click(function(){c+b.innerHeight()>=10?c=d.innerHeight()%b.innerHeight()==0?-d.innerHeight()+b.innerHeight():-d.innerHeight()+d.innerHeight()%b.innerHeight():c+=b.innerHeight();d.animate({top:c})});$(a+" .imBottomArrow").click(function(){-c<d.height()-b.innerHeight()?c-=b.innerHeight():c=0;d.animate({top:c})})},Page:function(a){var b=$(a),d=$(a+" .imSPage"), c=$(a+" .imRunner"),e=0;c.width(d.length*d.width());b.append('<div class="imSControls"><p class="imPPrev"><</p><p class="imPNext">></p></div>');var h=$(a+" .imSControls");h.css({"-moz-border-top-left-radius":10,"-moz-border-top-right-radius":10,"-moz-border-bottom-right-radius":0,"-moz-border-bottom-left-radius":0,"-webkit-border-top-left-radius":10,"-webkit-border-top-right-radius":10,"-webkit-border-bottom-right-radius":0,"-webkit-border-bottom-left-radius":0,"border-top-left-radius":10,"border-top-right-radius":10, "border-bottom-right-radius":0,"border-bottom-left-radius":0,color:"black"});h.fadeTo(0,0.9);$(a+" .imPPrev").click(function(){e+d.width()>0?e=-c.width()+d.width():e+=d.width();c.animate({left:e})});$(a+" .imPNext").click(function(){e-d.width()<-c.width()+d.width()?e=0:e-=d.width();c.animate({left:e})});b.mouseleave(function(){h.stop(!0,!0);h.animate({bottom:-h.height()-50})});b.mouseover(function(){h.stop(!0,!0);h.animate({bottom:0})})}},imTip:{constants:{locked:"imFixedTip",classId:"imTip",arrowClassId:"imTipArrow", borderClassId:"imTipArrowBorder"},Show:function(a,b){var d=null,c=!1,e=null,h=200,g="top",f=!1,j=x5engine.utils.createId(x5engine.imTip.constants.classId),l="",i="",a=$(a);a.find("img").length>0&&a.find("img").outerHeight()>a.outerHeight()&&(a=a.find("img"));($(a).attr("id")==""||$(a).attr("id")==null)&&$(a).attr("id",x5engine.utils.createId(x5engine.imTip.constants.classId+"_target"));b.borderRadius=b.borderRadius||x5engine.settings.imTip.borderRadius;b.classes=b.classes||x5engine.settings.imTip.classes; if(b.shadow==null)b.shadow=x5engine.settings.imTip.shadow;if(b.arrow==null)b.arrow=x5engine.settings.imTip.arrow;b.position=b.position||x5engine.settings.imTip.position;b.effect=b.effect||x5engine.settings.imTip.effect;b.showTail=b.showTail||x5engine.settings.imTip.showTail;if(b.hideOnFocus==null)b.hideOnFocus=!1;if(b.persistant==null)b.persistant=x5engine.settings.imTip.persistant;if(b.unique==null)b.unique=x5engine.settings.imTip.unique;if(b.text==""||b.text==null){if(b.text=a.attr("title"),b.text== null&&(a=a.find("[title]")),a!=null)b.text=a.attr("title")}else a.find("[title]").length>0&&(a=a.find("[title]"));i=a.attr("alt");l=a.attr("title");a.attr("title","").attr("alt","");b.text=b.text.replace(/&/g,"&");b.text=b.text.replace(/</g,"<");b.text=b.text.replace(/>/g,">");b.text=b.text.replace(/"/g,'"');var k=function(){if(!f){var g=$("[tiptarget="+$(a).attr("id")+"]");if(g.length==0)if(g='<div id="'+j+'_wrapper"><div tiptarget="'+$(a).attr("id")+'" class="'+x5engine.imTip.constants.classId+ " "+b.classes+'" id="'+j+'">'+b.text+(b.showTail?'<div class="'+x5engine.imTip.constants.borderClassId+'"></div><div class="'+x5engine.imTip.constants.arrowClassId+'"></div>':"")+"</div></div>",$("#imPage").append(g),e=$("#"+j),f=!0,b.width!=null&&b.width!=void 0&&e.width(b.width),e.find("object").each(function(){e.css({height:Math.max($(this).height(),40)})}),e.fadeOut(0),e.css({zIndex:x5engine.settings.zIndex.tip}),b.arrow||(e.find("."+x5engine.imTip.constants.arrowClassId).fadeOut(),e.find("."+ x5engine.imTip.constants.borderClassId).fadeOut()),b.borderRadius!=0&&(e.css("-webkit-border-radius",b.borderRadius),e.css("-moz-border-radius",b.borderRadius),e.css("border-radius",b.borderRadius)),b.shadow&&(e.css("box-shadow","0px 0px 5px #888"),e.css("-webkit-box-shadow","0px 0px 5px #888"),e.css("-moz-box-shadow","0px 0px 5px #888")),$(a).mouseleave(q),e.mouseleave(q),e.mouseenter(r),$(a).mouseenter(r),clearTimeout(d),c=!1,e.find("img").length>0){var h=e.find("img"),g=h.attr("src");h.attr("src", "null");h.load(function(){h.unbind("load");var a=o(b.position,e);p(a,e)});h.attr("src",g)}else g=o(b.position,e),p(g,e);else g!=null&&g.html().indexOf(b.text)==-1&&g.find("."+x5engine.imTip.constants.borderClassId).before("<br />"+b.text)}},o=function(c,d,e){var f,h,j=$(a).offset(),i=$("#imPage").offset(),e=e||0;j.top-=$(a).scrollTop()+i.top;j.left-=$(a).scrollLeft()+i.left;var i=null,k=10;b.showTail&&(i=d.find("."+x5engine.imTip.constants.arrowClassId).css("border-bottom-width"),i=parseInt(i.substring(0, i.length-2)),k=d.find("."+x5engine.imTip.constants.borderClassId).css("border-bottom-width"),parseInt(k.substring(0,k.length-2)));k=d.css("background-color");if(e>3)return c=(d.width()-i/3)/2,d.find("."+x5engine.imTip.constants.arrowClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent",borderBottomColor:"transparent",borderTopColor:k,position:"absolute",left:c,bottom:-2*i+1}),d.find("."+x5engine.imTip.constants.borderClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent", borderBottomColor:"transparent",position:"absolute",left:c,bottom:-2*i}),d.css("position","fixed"),[$(window).width()/2,$(window).height()/2];if(c=="top"){g="top";if(j.top-d.outerHeight()-2*i-10-$(window).scrollTop()<0)return o("bottom",d,e+1);h=j.left+($(a).outerWidth()-d.outerWidth())/2;f=j.top-d.outerHeight()-2*i;h<0&&(h=10);h+d.outerWidth()>$(window).width()&&(h=$(window).width()-d.outerWidth()-10);c=(d.width()-i/3)/2;d.find("."+x5engine.imTip.constants.arrowClassId).css({borderLeftColor:"transparent", borderRightColor:"transparent",borderBottomColor:"transparent",borderTopColor:k,position:"absolute",left:c,bottom:-2*i+1});d.find("."+x5engine.imTip.constants.borderClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent",borderBottomColor:"transparent",position:"absolute",left:c,bottom:-2*i})}else if(c=="bottom"){g="bottom";if(j.top+$(a).outerHeight()+2*i-$(window).scrollTop()>$(window).height())return o("left",d,e+1);h=j.left+($(a).width()-d.width())/2;f=j.top+$(a).outerHeight()+ 10;h<0&&(h=10);h+d.outerWidth()>$(window).width()&&(h=$(window).width()-d.outerWidth()-10);c=(d.width()-i/3)/2;d.find("."+x5engine.imTip.constants.arrowClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",borderBottomColor:k,position:"absolute",left:c,top:-2*i+1});d.find("."+x5engine.imTip.constants.borderClassId).css({borderLeftColor:"transparent",borderRightColor:"transparent",borderTopColor:"transparent",position:"absolute",left:c,top:-2*i})}else if(c== "left"){if(j.left-d.outerWidth()-$(window).scrollLeft()<0)return o("top",d,e+1);h=j.left-d.outerWidth()-2*i;f=j.top+($(a).outerHeight()-d.outerHeight())/2;if(f-$(window).scrollTop()<0)return o("bottom",d,e+1);if(f+d.outerHeight()-$(window).scrollTop()>$(window).height())return o("top",d,e+1);d.find("."+x5engine.imTip.constants.arrowClassId).css({borderRightColor:"transparent",borderBottomColor:"transparent",borderTopColor:"transparent",borderLeftColor:k,position:"absolute",right:-2*i+1,top:d.outerHeight()/ 2-i});d.find("."+x5engine.imTip.constants.borderClassId).css({borderRightColor:"transparent",borderBottomColor:"transparent",borderTopColor:"transparent",position:"absolute",right:-2*i,top:d.outerHeight()/2-i})}else if(c=="right"){if(j.left+$(a).outerWidth()+d.outerWidth()-$(window).scrollLeft()>$(window).width())return o("top",d,e+1);h=j.left+$(a).outerWidth()+2*i;f=j.top+($(a).outerHeight()-d.outerHeight())/2;if(f-$(window).scrollTop()<0)return o("bottom",d,e+1);if(f+d.outerHeight()-$(window).scrollTop()> $(window).height())return o("top",d,e+1);d.find("."+x5engine.imTip.constants.arrowClassId).css({borderLeftColor:"transparent",borderBottomColor:"transparent",borderTopColor:"transparent",position:"absolute",borderRightColor:k,left:-2*i+1,top:d.outerHeight()/2-i});d.find("."+x5engine.imTip.constants.borderClassId).css({borderLeftColor:"transparent",borderBottomColor:"transparent",borderTopColor:"transparent",position:"absolute",left:-2*i,top:d.outerHeight()/2-i})}return[f,h]},p=function(c,d){if($(a).hasClass(x5engine.imTip.constants.locked))switch(b.effect){case "fade":d.css({top:c[0], left:c[1]});d.fadeIn();break;case "bounce":g=="top"?d.css({top:c[0]-50,left:c[1]}):d.css({top:c[0]+50,left:c[1]});d.fadeIn(100);d.animate({top:c[0],left:c[1]},600,"imBounce");break;default:d.css({top:c[0],left:c[1]}),h=0,d.fadeIn(0)}},r=function(){clearTimeout(d);c=!1},q=function(){b.persistant||(clearTimeout(d),d=setTimeout(n,250),c=!0)},n=function(){clearTimeout(d);c&&($(a).removeClass(x5engine.imTip.constants.locked),e!=null&&(e.stop(),e.find("object, embed").remove(),e.fadeOut(h,function(){e.remove(); f=!1;$(a).attr("title",l);$(a).attr("alt",i)})))};(function(){var d=$("[tiptarget="+$(a).attr("id")+"]");if(d.length==0||d.length>0&&d.html().indexOf(b.text)==-1)b.unique&&$("."+x5engine.imTip.constants.classId).length>0&&($("."+x5engine.imTip.constants.classId).remove(),h=0),$(a).addClass(x5engine.imTip.constants.locked),c=!1,k();if(b.hideOnFocus!=null)if(typeof b.hideOnFocus=="boolean")$(a).hasClass("imDatePickerIcon")?($(a).parent().prev("input[type=text]").focus(function(){c=!0;$(a).removeClass(x5engine.imForm.constants.mark); n()}),$(a).click(function(){$(a).parent().prev("input[type=text]").focus()})):$(a).click(function(){c=!0;$(a).removeClass(x5engine.imForm.constants.mark);n()});else if(typeof b.hideOnFocus=="object"||typeof b.hideOnFocus=="string")$(b.hideOnFocus).click(function(){c=!0;$(b.hideOnFocus).removeClass(x5engine.imForm.constants.mark);$(a).removeClass(x5engine.imForm.constants.mark);n()}),$(a).click(function(){c=!0;$(a).removeClass(x5engine.imForm.constants.mark);$(b.hideOnFocus).removeClass(x5engine.imForm.constants.mark); n()})})();return j}},imMarquee:function(a){a.direction=a.direction||"up";a.easing=a.easing||"linear";a.speed=a.speed||2E3;a.bounce=a.bounce||!1;a.type=a.type||"inner";var b=$(a.object),d=b.html();b.empty().append('<div class="imRoller">'+d+"</div>");b.css({position:"relative",overflow:"hidden"});var c=$(a.object+" .imRoller");c.css("position","relative");var e=function(){var d;switch(a.direction){case "up":d=a.type=="inner"?b.innerHeight()-c.outerHeight():b.innerHeight();c.css({top:d});break;case "BOTTOM":d= a.type=="inner"?0:-c.outerHeight();c.css({top:d});break;case "right":d=a.type=="inner"?0:-c.outerWidth();c.css({left:d});break;case "left":d=a.type=="inner"?b.innerWidth()-c.outerWidth():b.innerWidth(),c.css({left:d})}},h=function(){var d;if(a.bounce)switch(a.direction){case "up":a.direction="BOTTOM";break;case "BOTTOM":a.direction="up";break;case "left":a.direction="right";break;case "right":a.direction="left"}e();switch(a.direction){case "up":d=a.type=="inner"?0:-c.outerHeight();c.animate({top:d}, a.speed,a.easing,function(){h()});break;case "BOTTOM":d=a.type=="inner"?b.innerHeight()-c.outerHeight():b.innerHeight();c.animate({top:d},a.speed,a.easing,function(){h()});break;case "right":d=a.type=="inner"?b.innerWidth()-c.outerWidth():b.innerWidth();c.animate({left:d},a.speed,a.easing,function(){h()});break;case "left":d=a.type=="inner"?0:-c.outerWidth(),c.animate({left:-c.outerWidth()},a.speed,a.easing,function(){h()})}};h()},imBgStretch:function(a,b){b==null&&(b=!0);var d=null,c=null,e=function(){c== null&&(c=g.width()/g.height());$(window).width();$(window).height();var a,b,d;a=$(window).width();b=$(window).width()/c;b<$(window).height()&&(b=$(window).height(),a=$(window).height()*c);$(window).height();d=($(window).width()-a)/2;h.css({width:a,height:b,top:0,left:d});g.css({width:a,height:b})};$(".imBgStretcher").remove();$("body").prepend('<div class="imBgStretcher"><img /></div><div class="imBgStretcher imBgWrap"> </div>');var h=$(".imBgStretcher"),g=$(".imBgStretcher img");h.css({position:"fixed", top:0,left:0,zIndex:0,overflow:"hidden",backgroundColor:"transparent"});$(".imBgWrap").css("z-index",0);$("#imFooterBg").css({position:"relative"});g.load(e);$(window).resize(function(){b?e():(d!=null&&clearTimeout(d),d=setTimeout(e,100))});g.attr("src",a)},imAccordion:function(a,b){var d=null,c=null,e=function(a,b){b=b||400;d=d||a.css("padding");c=c||a.height();a.css({padding:0,overflow:"hidden"});a.animate({height:0,padding:0},b)},h=function(a,b){a.css({padding:d,overflow:"hidden"});a.animate({height:c}, b)};e($(a+" .imAccContent"),1);for(var g=0;g<$(a+" li").length;g++)$(a+" li:eq("+g+")").attr("id",x5engine.utils.createId("imAccLi"));b!=null&&h($(a+" li:eq("+b+") .imAccContent"),1);$(a+" li").click(function(){if($(this).find(".imAccContent").height()==0){for(var b=0;b<$(a+" li").length;b++)$(a+" li:eq("+b+")").attr("id")!=$(this).attr("id")&&e($(a+" li:eq("+b+") .imAccContent"));h($(this).find(".imAccContent"))}else e($(this).find(".imAccContent"))})},imStarRating:function(a,b){var d=null,c,e=function(){d!= null&&clearTimeout(d);var c=$(this).attr("class");c.match(/imStarRating\[([0-9]*)\]/);for(var c=RegExp.$1,e=0;e<b;e++)e<c?$("#"+a+"_star"+(e+1)).attr("src","res/star_full.png"):$("#"+a+"_star"+(e+1)).attr("src","res/star_empty.png")},h=function(){d=setTimeout(function(){for(var c=0;c<b;c++)$("#"+a+"_star"+(c+1)).attr("src","res/star_empty.png")},50)},g=function(){var c=$(this).attr("class");c.match(/imStarRating\[([0-9]*)\]/);c=RegExp.$1;($.imCookie(a)==null||$.imCookie(a)==!1)&&$.ajax({url:window.location.href, type:"POST",data:{value:c,scale:b,id:a},success:function(){$.imCookie(a,"y");window.location.href=window.location.href}})};for(c=0;c<b;c++)$("#"+a+"_star"+(c+1)).mouseover(e),$("#"+a+"_star"+(c+1)).mouseleave(h),$("#"+a+"_star"+(c+1)).click(g)},imGrid:{cell:function(a){var b,d,c,e,h,g=!1,f=function(){b=$(a).offset().top;d=b+$(a).outerHeight()},j=function(){c=$(a).offset().left;e=c+$(a).outerWidth()};this.height=function(b){if(b==null)return $(a).height();else $(a).height(b-($(a).outerHeight()-$(a).height()))}; this.pushY=function(b){$(a).css("top").match(/^([0-9]+)[a-z]*$/);var c=RegExp.$1*1;c+=b;$(a).css("top",c+"px")};this.html=function(b){if(b==null)return $(a).html();else $(a).html(b)};this.isAbsolute=function(a){if(a==null)return g;else g=a};this.sy=function(){f();return b};this.ey=function(){f();return d};this.sx=function(){j();return c};this.ex=function(){j();return e};$(a).offset();h=function(){var b=$(a).css("height");$(a).css("height","auto");var c=$(a).height();$(a).find("[class*=imCpt]").not("iframe").length> 0&&(c+=30);$(a).css("height",b);return c}();$(a).height()<h&&$(a).height(h)},init:function(){if(x5engine.settings.imGrid.enabled){var a=[],b=[],d,c,e=$("#imFooPad"),h,g;if(e.length>0)g=e.offset(),g=g.top,h=g+e.innerHeight();$("[class*=imGrid]").each(function(){var c=$(this).attr("class"),d,e,f=!1;/imGrid\[[0-9]+,\s*[0-9]+[,]*\s*[0-9]*\]/.test(c)&&(c.match(/imGrid\[([0-9]+),\s*([0-9]+)[,]?\s*([0-9]*)\]/),c=RegExp.$1*1,d=RegExp.$2*1,RegExp.$3*1==1&&(f=!0),a[d]==null&&(a[d]=[]),b[c]==null&&(b[c]=[]), e=new x5engine.imGrid.cell($(this)),e.isAbsolute(f),a[d][a[d].length]=e,b[c][b[c].length]=e)});for(d=0;d<a.length;d++)if(a[d]!=null){var f=0;for(c=0;c<a[d].length;c++){if(a[d][c].isAbsolute()&&d!=0)for(c2=0;c2<a[d-1].length;c2++){var j=a[d-1][c2],l=a[d][c];j.ey()>l.sy()&&(j.sx()<l.ex()||j.ex()>l.sx())&&l.pushY(j.ey()-l.sy())}a[d][c].ey()>f&&(f=a[d][c].ey())}for(c=0;c<a[d].length;c++)a[d][c].height(f-a[d][c].sy())}e.length>0&&(f>h?e.remove():e.height(h-g-f-($("#imBtMn").length>0?$("#imBtMn").outerHeight(): 0)))}}},imAccess:{showLogout:function(){$(".imLogout").empty();x5engine.utils.isOnline()?$.imCookie("im_access_cookie_uid")!=null&&$.imCookie("im_access_cookie_uid")!=""&&$(".imLogout").append('<a class="imLogoutLink" href="res/imlogout.php">'+x5engine.l10n.getLocalization("private_area_logout")+"</a>"):$(".imLogout").append('<a class="imLogoutLink" href="#">'+x5engine.l10n.getLocalization("private_area_logout")+"</a>")}},imSearch:{current:null,Load:function(){$("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").fadeOut(0); $("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").first().fadeIn(0);x5engine.imSearch.current="#"+$("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").first().attr("id");$("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").length<2&&($("#imSearchSideBar").hide(0),$("#imSearchContent").css({width:"100%"}))},Show:function(a){a!=x5engine.imSearch.current&&$("#imSearchWebPages, #imSearchBlog, #imSearchProducts, #imSearchImages, #imSearchVideos").fadeOut(1, function(){$(a).fadeIn(0);x5engine.imSearch.current=a});return!1}},imSiteMap:{toggleLevel:function(a){a=$(a);$(a).next(".imSiteMap").slideToggle("medium","swing",function(){$(a).next("ul:visible").length>0?$(a).children("img").attr("src","res/imfolder_open.gif"):$(a).children("img").attr("src","res/imfolder_closed.gif")});return!1},foldAll:function(){$("#imContent > ul").find(".imSiteMap").slideUp("medium","swing",function(){$(this).prev("span").children("img").attr("src","res/imfolder_closed.gif")}); return!1},unfoldAll:function(){$("#imContent > ul").find(".imSiteMap").slideDown("medium","swing",function(){$(this).prev("span").children("img").attr("src","res/imfolder_open.gif")});return!1}}};